From 6b72a4ddb05c7226d58d0f156db13153dec4a0e8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 23 Jan 2023 18:36:04 -0700 Subject: [PATCH] Revert "[sanitize] Simplify(?) check_range" This reverts commit af0b1ef8a72d4f6b778dbba3606ebe7df39d5288. --- src/hb-sanitize.hh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/hb-sanitize.hh b/src/hb-sanitize.hh index 5b9fe92a4..eb907c6b2 100644 --- a/src/hb-sanitize.hh +++ b/src/hb-sanitize.hh @@ -248,15 +248,25 @@ struct hb_sanitize_context_t : return likely (ok); } - template + template bool check_range (const T *base, unsigned int a, - unsigned int b, - Ts&... ds) const + unsigned int b) const { unsigned m; return !hb_unsigned_mul_overflows (a, b, &m) && - this->check_range (base, m, ds...); + this->check_range (base, m); + } + + template + bool check_range (const T *base, + unsigned int a, + unsigned int b, + unsigned int c) const + { + unsigned m; + return !hb_unsigned_mul_overflows (a, b, &m) && + this->check_range (base, m, c); } template