summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c6
1 files changed, 6 insertions, 0 deletions
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. */