From bdadb244dbc743bdb32c9b5f33d0940d55b93f8d Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 28 May 2022 11:27:51 -0600 Subject: regexec.c: Restore overzealous removal for GH#8369 I fixed this locally as a result of Hugo van der Sanden's comment in #19636, but neglected to commit it. --- regexec.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'regexec.c') diff --git a/regexec.c b/regexec.c index 9c4c06e16b..9e6e363d0f 100644 --- a/regexec.c +++ b/regexec.c @@ -8794,6 +8794,12 @@ NULL case WHILEM_B_min_fail: /* just failed to match B in a minimal match */ cur_curlyx = ST.save_curlyx; + if (cur_curlyx->u.curlyx.count >= /*max*/ARG2(cur_curlyx->u.curlyx.me)) { + /* Maximum greed exceeded */ + cur_curlyx->u.curlyx.count--; + CACHEsayNO; + } + DEBUG_EXECUTE_r(Perl_re_exec_indentf( aTHX_ "WHILEM: B min fail: trying longer...\n", depth) ); /* Try grabbing another A and see if it helps. */ -- cgit v1.2.1