Skip to content

Commit

Permalink
fix [perl #128085] SIGSEGV in S_regmatch with S_study_chunk: Assertio…
Browse files Browse the repository at this point in the history
…n "!frame" failed.

The goto target should have been before the if (frame) block.

Clearly this code is not well tested in our test suite. This patch
does NOT include tests.
  • Loading branch information
demerphq committed May 10, 2016
1 parent 8df928d commit 2f3182e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5899,15 +5899,10 @@ Perl_re_printf( aTHX_ "LHS=%"UVuf" RHS=%"UVuf"\n",
/* Else: zero-length, ignore. */
scan = regnext(scan);
}
/* If we are exiting a recursion we can unset its recursed bit
* and allow ourselves to enter it again - no danger of an
* infinite loop there.
if (stopparen > -1 && recursed) {
DEBUG_STUDYDATA("unset:", data,depth);
PAREN_UNSET( recursed, stopparen);
}
*/

finish:
if (frame) {
/* we need to unwind recursion. */
depth = depth - 1;

DEBUG_STUDYDATA("frame-end:",data,depth);
Expand All @@ -5924,7 +5919,6 @@ Perl_re_printf( aTHX_ "LHS=%"UVuf" RHS=%"UVuf"\n",
goto fake_study_recurse;
}

finish:
assert(!frame);
DEBUG_STUDYDATA("pre-fin:",data,depth);

Expand Down

0 comments on commit 2f3182e

Please sign in to comment.