In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/4c2aa7c802893d0276551ade1b9d5dcd1226afc4?hp=01aed385e6bdbdcfd13bb66e9d8b7c55d2cfc34a>
- Log ----------------------------------------------------------------- commit 4c2aa7c802893d0276551ade1b9d5dcd1226afc4 Author: Karl Williamson <k...@cpan.org> Date: Thu Oct 10 18:32:53 2019 -0600 Don't test for 16-bit inputs in inRANGE() This macro has been expanding to overflow some assertion strings on Windows and HP. This commit omits handling one unlikely scenario, namely that the input is a short, 16-bits. And that is enough to get it to compile on Windows. HP isn't smoked on branches, so I don't know if this will fix it. More discussion may be needed, but this is all I have time for at the moment. commit c983409f490b4a541fa05fb421d7ee150d4faf07 Author: Tony Cook <t...@develop-help.com> Date: Wed Oct 9 11:12:09 2019 -0600 regexec.c: Fix Win32 compilation The macro being called here had a parameter that was a function call and was used multiple times in the macro, exceeding some limits on Win32, and potentially being actually called multiple times. ----------------------------------------------------------------------- Summary of changes: handy.h | 1 - regexec.c | 22 ++++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/handy.h b/handy.h index 180aeca306..115efda342 100644 --- a/handy.h +++ b/handy.h @@ -1278,7 +1278,6 @@ or casts * needed. */ #define inRANGE(c, l, u) (__ASSERT_((u) >= (l)) \ ( (sizeof(c) == sizeof(U8)) ? withinCOUNT(((U8) (c)), (l), ((u) - (l))) \ - : (sizeof(c) == sizeof(U16)) ? withinCOUNT(((U16) (c)), (l), ((u) - (l))) \ : (sizeof(c) == sizeof(U32)) ? withinCOUNT(((U32) (c)), (l), ((u) - (l))) \ : (__ASSERT_(sizeof(c) == sizeof(WIDEST_UTYPE)) \ withinCOUNT(((WIDEST_UTYPE) (c)), (l), ((u) - (l)))))) diff --git a/regexec.c b/regexec.c index 5228c85fac..3c679c10ec 100644 --- a/regexec.c +++ b/regexec.c @@ -6527,9 +6527,9 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) if (locinput == reginfo->strbeg) b1 = isWORDCHAR_LC('\n'); else { - b1 = isWORDCHAR_LC_utf8_safe(reghop3((U8*)locinput, -1, - (U8*)(reginfo->strbeg)), - (U8*)(reginfo->strend)); + U8 *p = reghop3((U8*)locinput, -1, + (U8*)(reginfo->strbeg)); + b1 = isWORDCHAR_LC_utf8_safe(p, (U8*)(reginfo->strend)); } b2 = (NEXTCHR_IS_EOS) ? isWORDCHAR_LC('\n') @@ -6606,13 +6606,15 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) case TRADITIONAL_BOUND: { bool b1, b2; - b1 = (locinput == reginfo->strbeg) - ? 0 /* isWORDCHAR_L1('\n') */ - : isWORDCHAR_utf8_safe( - reghop3((U8*)locinput, - -1, - (U8*)(reginfo->strbeg)), - (U8*) reginfo->strend); + if (locinput == reginfo->strbeg) { + b1 = 0 /* isWORDCHAR_L1('\n') */; + } + else { + U8 *p = reghop3((U8*)locinput, -1, + (U8*)(reginfo->strbeg)); + + b1 = isWORDCHAR_utf8_safe(p, (U8*) reginfo->strend); + } b2 = (NEXTCHR_IS_EOS) ? 0 /* isWORDCHAR_L1('\n') */ : isWORDCHAR_utf8_safe((U8*)locinput, -- Perl5 Master Repository