From: Ilya Zakharevich Date: Mon, 1 Nov 1999 18:14:16 +0000 (-0500) Subject: Re: [ID 19991026.001] perl segmentation fault report X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3cf5c1959ebd22791f34a1706083a3ce9aa50a39;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 19991026.001] perl segmentation fault report To: lvirden@cas.org (Larry W. Virden) Cc: perl5-porters@perl.org, lvirden@cas.org Message-Id: <199911012314.SAA22664@monk.mps.ohio-state.edu> p4raw-id: //depot/cfgperl@4507 --- diff --git a/regexec.c b/regexec.c index 684e344..da06e7f 100644 --- a/regexec.c +++ b/regexec.c @@ -643,6 +643,9 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, prog->check_substr = Nullsv; /* disable */ prog->float_substr = Nullsv; /* clear */ s = strpos; + /* XXXX This is a remnant of the old implementation. It + looks wasteful, since now INTUIT can use many + other heuristics too. */ prog->reganch &= ~RE_USE_INTUIT; } else @@ -805,9 +808,13 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char * after_try: if (s >= end) goto phooey; - s = re_intuit_start(prog, sv, s + 1, strend, flags, NULL); - if (!s) - goto phooey; + if (prog->reganch & RE_USE_INTUIT) { + s = re_intuit_start(prog, sv, s + 1, strend, flags, NULL); + if (!s) + goto phooey; + } + else + s++; } } else { if (s > startpos) diff --git a/t/op/pat.t b/t/op/pat.t index f36394e..5c564aa 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -4,7 +4,7 @@ # the format supported by op/regexp.t. If you want to add a test # that does fit that format, add it to op/re_tests, not here. -print "1..193\n"; +print "1..194\n"; BEGIN { chdir 't' if -d 't'; @@ -893,3 +893,8 @@ pos($text)=0; $text =~ /\GXb*X/g and print 'not '; print "ok $test\n"; $test++; + +$text = "xA\n" x 500; +$text =~ /^\s*A/m and print 'not '; +print "ok $test\n"; +$test++;