diff options
author | Yves Orton <demerphq@gmail.com> | 2017-01-27 16:57:40 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2017-01-27 17:04:09 +0100 |
commit | bb78386f13c18a1a7dae932b9b36e977056b13c7 (patch) | |
tree | 62f5b4a3bd76867a833d41cea237159489734577 /regcomp.c | |
parent | 1cde3371bb6a7d2f24de42ef82c0028a0a50f195 (diff) | |
download | perl-bb78386f13c18a1a7dae932b9b36e977056b13c7.tar.gz |
only mess with NEXT_OFF() when we are in PASS2
In 31fc93954d1f379c7a49889d91436ce99818e1f6 I added code that would modify
NEXT_OFF() when we were not in PASS2, when we should not do so. Strangly this
did not segfault when I tested, but this fix is required.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -11709,11 +11709,11 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) nextchar(pRExC_state); if (max < min) { /* If can't match, warn and optimize to fail unconditionally */ + reginsert(pRExC_state, OPFAIL, orig_emit, depth+1); if (PASS2) { ckWARNreg(RExC_parse, "Quantifier {n,m} with n > m can't match"); + NEXT_OFF(orig_emit)= regarglen[OPFAIL] + NODE_STEP_REGNODE; } - reginsert(pRExC_state, OPFAIL, orig_emit, depth+1); - NEXT_OFF(orig_emit)= regarglen[OPFAIL] + NODE_STEP_REGNODE; return ret; } else if (min == max && *RExC_parse == '?') |