From: Andreas König Date: Tue, 12 Mar 2002 00:40:09 +0000 (+0100) Subject: SEGV in s/// and UTF-8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e602e293de56675e46a43a5c73830035f39277b;p=p5sagit%2Fp5-mst-13.2.git SEGV in s/// and UTF-8 Message-ID: p4raw-id: //depot/perl@15268 --- diff --git a/regexec.c b/regexec.c index 1383231..f620a34 100644 --- a/regexec.c +++ b/regexec.c @@ -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 4fb3d45..67ca765 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"; +}