diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-03-09 21:28:35 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-03-09 22:08:38 -0700 |
commit | ac51e94be5daabecdeb0ed734f3ccc059b7b77e3 (patch) | |
tree | 0041f6854de9be9b0d846976222790262acd7d45 /regexec.c | |
parent | 557d584c578ba8b01a3c9eb7a3b88b7abb1855bb (diff) | |
download | perl-ac51e94be5daabecdeb0ed734f3ccc059b7b77e3.tar.gz |
regexec.c: don't try accessing non-bitmap if doesn't exist
ANYOF_NONBITMAP is supposed to be set iff there is something outside
the bitmap to try matching in an ANYOF node. Due to slight changes in
the meaning of this, the code has been trying to access this
if ANYOF_NONBITMAP_NON_UTF8 is set without ANYOF_NONBITMAP being set,
which means it was trying to access something that doesn't exist.
I'm hopeful, based on a stack trace sent to me that this is the cause
of [perl #85478], but can't reproduce that easily. But the logic
is clearly wrong.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -6597,11 +6597,12 @@ S_reginclass(pTHX_ const regexp * const prog, register const regnode * const n, if (utf8_target && (flags & ANYOF_UNICODE_ALL) && c >= 256) { match = TRUE; /* Everything above 255 matches */ } - else if ((flags & ANYOF_NONBITMAP_NON_UTF8 - || (utf8_target && ANYOF_NONBITMAP(n) - && (c >=256 - || (! (flags & ANYOF_LOCALE)) - || (flags & ANYOF_IS_SYNTHETIC))))) + else if (ANYOF_NONBITMAP(n) + && (flags & ANYOF_NONBITMAP_NON_UTF8) + || (utf8_target + && (c >=256 + || (! (flags & ANYOF_LOCALE)) + || (flags & ANYOF_IS_SYNTHETIC)))) { AV *av; SV * const sw = regclass_swash(prog, n, TRUE, 0, (SV**)&av); |