diff options
-rw-r--r-- | regexec.c | 2 | ||||
-rwxr-xr-x | t/op/pat.t | 9 |
2 files changed, 9 insertions, 2 deletions
@@ -2425,7 +2425,7 @@ S_regmatch(pTHX_ regnode *prog) sayNO_ANYOF; if (locinput >= PL_regeol) sayNO; - locinput += inclasslen; + locinput += inclasslen ? inclasslen : 1; nextchr = UCHARAT(locinput); break; } diff --git a/t/op/pat.t b/t/op/pat.t index 4fb3d45e5e..67ca7659ad 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..860\n"; +print "1..861\n"; BEGIN { chdir 't' if -d 't'; @@ -2706,3 +2706,10 @@ print "# some Unicode properties\n"; $i++; } } + +{ + print "# SEGV in s/// and UTF-8\n"; + $s = "s#\x{100}" x 4; + $s =~ s/[^\w]/ /g; + print $s eq "s \x{100}" x 4 ? "ok 861\n" : "not ok 861\n"; +} |