diff options
author | Yves Orton <demerphq@gmail.com> | 2023-01-14 11:46:03 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-01-15 17:20:48 +0100 |
commit | 37040543d024b3ecb0aecd78849bd5af61408d02 (patch) | |
tree | 971e23b6036477ccd688359e190b70f2858c6e31 /MANIFEST | |
parent | 3645ca4ee1a59fae1a6d6817c4582968ffd0a731 (diff) | |
download | perl-37040543d024b3ecb0aecd78849bd5af61408d02.tar.gz |
regexec.c - fix memory leak in EVAL.
EVAL was calling regcppush twice per invocation, once before executing the
callback, and once after. But not regcppop'ing twice. So each time we
would accumulate an extra "frame" of data. This is/was hidden somewhat by
the way we eventually "blow" the stack, so the extra data was just thrown
away at the end.
This removes the second set of pushes so that the save stack stays a stable
size as it unwinds from each failed eval.
We also weren't cleaning up after a (?{...}) when we failed to match to its
right. This unwinds the stack and restores the parens properly.
This adds tests to check how the save stack grows during patterns using
(?{ ... }) and (??{ ... }) and ensure that when we backtrack and re-execute
the EVAL again it cleans up the stack as it goes.
Diffstat (limited to 'MANIFEST')
-rw-r--r-- | MANIFEST | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -4677,6 +4677,7 @@ ext/XS-APItest/t/refs.t Test typemap ref handling ext/XS-APItest/t/rmagical.t XS::APItest extension ext/XS-APItest/t/rv2cv_op_cv.t test rv2cv_op_cv() API ext/XS-APItest/t/savehints.t test SAVEHINTS() API +ext/XS-APItest/t/savestack.t test savestack behavior, currently only in the regex engine ext/XS-APItest/t/scopelessblock.t test recursive descent statement-sequence parsing ext/XS-APItest/t/sort.t Test sort(xs_cmp ...) ext/XS-APItest/t/stmtasexpr.t test recursive descent statement parsing |