Skip to content

Commit 1bda7a7

Browse files
committed
fix #128085 - SIGSEGV in S_regmatch with S_study_chunk: Assertion "!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.
1 parent e1e9e45 commit 1bda7a7

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

regcomp.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5899,15 +5899,10 @@ Perl_re_printf( aTHX_ "LHS=%"UVuf" RHS=%"UVuf"\n",
58995899
/* Else: zero-length, ignore. */
59005900
scan = regnext(scan);
59015901
}
5902-
/* If we are exiting a recursion we can unset its recursed bit
5903-
* and allow ourselves to enter it again - no danger of an
5904-
* infinite loop there.
5905-
if (stopparen > -1 && recursed) {
5906-
DEBUG_STUDYDATA("unset:", data,depth);
5907-
PAREN_UNSET( recursed, stopparen);
5908-
}
5909-
*/
5902+
5903+
finish:
59105904
if (frame) {
5905+
/* we need to unwind recursion. */
59115906
depth = depth - 1;
59125907

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

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

0 commit comments

Comments
 (0)