X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/e64f369d58efdbd31eecf147ef006f0f69e17fc2..45ccb7bbaadd51904a7fe1262254aac938f3e9f1:/regexec.c diff --git a/regexec.c b/regexec.c index fe5dfab..a5451b6 100644 --- a/regexec.c +++ b/regexec.c @@ -660,8 +660,12 @@ Perl_re_intuit_start(pTHX_ REGEXP * const rx, SV *sv, char *strpos, DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "Not at start...\n")); goto fail; } - if (prog->check_offset_min == prog->check_offset_max && - !(prog->extflags & RXf_CANY_SEEN)) { + if (prog->check_offset_min == prog->check_offset_max + && !(prog->extflags & RXf_CANY_SEEN) + && ! multiline) /* /m can cause \n's to match that aren't + accounted for in the string max length. + See [perl #115242] */ + { /* Substring at constant offset from beg-of-str... */ I32 slen; @@ -7157,8 +7161,27 @@ S_regrepeat(pTHX_ const regexp *prog, char **startposp, const regnode *p, I32 ma } break; - default: /* Called on something of 0 width. */ - break; /* So match right here or not at all. */ + case BOUND: + case BOUNDA: + case BOUNDL: + case BOUNDU: + case EOS: + case GPOS: + case KEEPS: + case NBOUND: + case NBOUNDA: + case NBOUNDL: + case NBOUNDU: + case OPFAIL: + case SBOL: + case SEOL: + /* These are all 0 width, so match right here or not at all. */ + break; + + default: + Perl_croak(aTHX_ "panic: regrepeat() called with unrecognized node type %d='%s'", OP(p), PL_reg_name[OP(p)]); + assert(0); /* NOTREACHED */ + } if (hardcount)