Branch: refs/heads/yves/fix_zero_max_quantifier_in_regexec_c
Home: https://github.com/Perl/perl5
Commit: 266a50cf6e46cf871920dc27c2368b2ad7e8b7e9
https://github.com/Perl/perl5/commit/266a50cf6e46cf871920dc27c2368b2ad7e8b7e9
Author: Yves Orton <[email protected]>
Date: 2023-01-13 (Fri, 13 Jan 2023)
Changed paths:
M regexec.c
M t/re/subst.t
Log Message:
-----------
regexec.c - avoid calling regrepeat when the max is 0
When we have a max quantifier of 0, then the quantified
item is essentially a NOTHING reop. Regardless, we do not
need to call regrepeat, and doing so confuses some of the
logic it contains. Simply avoiding calling regrepeat()
fixes the underlying issue, and avoids the broken code.
This fixes GH Issue #20690.