From: Karl Williamson Date: Sat, 21 Oct 2017 23:24:11 +0000 (-0600) Subject: regcomp.c: Add assertion X-Git-Tag: v5.27.6~289 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/e0c80300c2e6ade197b7e621396c1303802f2b55 regcomp.c: Add assertion If this value is negative, something is wrong. --- diff --git a/regcomp.c b/regcomp.c index 18e87e1..95c3afc 100644 --- a/regcomp.c +++ b/regcomp.c @@ -628,7 +628,7 @@ static const scan_data_t zero_scan_data = { UTF8fARG(UTF, \ (xI(xC) > eC) /* Don't run off end */ \ ? eC - sC /* Length before the <--HERE */ \ - : xI_offset(xC), \ + : ( __ASSERT_(xI_offset(xC) >= 0) xI_offset(xC) ), \ sC), /* The input pattern printed up to the <--HERE */ \ UTF8fARG(UTF, \ (xI(xC) > eC) ? 0 : eC - xI(xC), /* Length after <--HERE */ \