From: Jarkko Hietaniemi Date: Wed, 14 Jul 1999 16:22:39 +0000 (+0000) Subject: The regexec.c change of #3606 caused a core dump in fbm_instr() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0033605d21c115bf932c13b3219a6ea9a9088d20;p=p5sagit%2Fp5-mst-13.2.git The regexec.c change of #3606 caused a core dump in fbm_instr() if its caller re_intuit_start() was entered with strend == strpos because end_shift ended up as -1. The patch ain't necessarily correct but least the core dump is avoided. p4raw-id: //depot/cfgperl@3671 --- diff --git a/regexec.c b/regexec.c index 4df60ac..e40d1c7 100644 --- a/regexec.c +++ b/regexec.c @@ -358,6 +358,8 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, } restart: + if (end_shift < 0) + end_shift = 0; /* can happen when strend == strpos */ if (flags & REXEC_SCREAM) { SV *c = prog->check_substr; char *strbeg = SvPVX(sv); /* XXXX Assume PV_force() on SCREAM! */