summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-03-10 08:17:05 -0700
committerKarl Williamson <public@khwilliamson.com>2011-03-10 09:37:58 -0700
commit6f8d7d0df3e3141d61246e6b0a3db12ab1fd7f92 (patch)
treee6b68e7132b9b4f0e975a7ed210017a3daef0c2a
parent1aa9930eb1f2ea53c64cbde87e9406c6b4e08d52 (diff)
downloadperl-6f8d7d0df3e3141d61246e6b0a3db12ab1fd7f92.tar.gz
regexec.c: Fix precedence
Commit ac51e94be5daabecdeb0ed734f3ccc059b7b77e3 didn't do what it purported, because it omitted parentheses that were necessary to change the natural precedence. It's strange that it passed all tests on my machine, and failed so miserably elsewhere that it was quickly reverted by commit 63c0bfd59562325fed2ac5a90088ed40960ac2ad. This reinstates it with the correct precedence. The next commit will add an assert() so that the underlying issue will be detected on all platforms
-rw-r--r--regexec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/regexec.c b/regexec.c
index 76784ee97f..b9e5852cd2 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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);