summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-07-14 16:22:39 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-07-14 16:22:39 +0000
commit0033605d21c115bf932c13b3219a6ea9a9088d20 (patch)
treef2262096d3079912f6b40df762865ccb89d239a2 /regexec.c
parent9957a2e3e158f4e81e60565d4555b3cdb404e14a (diff)
downloadperl-0033605d21c115bf932c13b3219a6ea9a9088d20.tar.gz
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
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 4df60acaa9..e40d1c7ea7 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! */