This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Macro needs param to be dereferenced
authorKarl Williamson <khw@cpan.org>
Fri, 29 Jan 2016 18:53:10 +0000 (11:53 -0700)
committerKarl Williamson <khw@cpan.org>
Fri, 29 Jan 2016 19:20:20 +0000 (12:20 -0700)
This is a potential bug, but didn't show up, as real addresses are
always going to be larger than 128, and hence the macro here would show
false, and the code only used true to short circuit some other code, so
it always would take the long way.

regexec.c

index e7a890d..8e1c1f6 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -6120,7 +6120,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
        case ANYOF:  /*   /[abc]/       */
             if (NEXTCHR_IS_EOS)
                 sayNO;
-           if (utf8_target && ! UTF8_IS_INVARIANT(locinput)) {
+           if (utf8_target && ! UTF8_IS_INVARIANT(*locinput)) {
                if (!reginclass(rex, scan, (U8*)locinput, (U8*)reginfo->strend,
                                                                    utf8_target))
                    sayNO;