9f141731d83a1ac6294a5580a5b11ff41490309a, part of the re_eval jumbo fix,
introduced a leak. It incremented the ref count of a run-time regex each
time it was re-used, i.e. where the pattern hadn't changed.
runtime_code = S_has_runtime_code(aTHX_ pRExC_state, expr, pm_flags,
exp, plen);
if (!runtime_code) {
- ReREFCNT_inc(old_re);
if (used_setjump) {
JMPENV_POP;
}
or skip_all("XS::APItest not available");
}
-plan tests => 21;
+plan tests => 22;
# run some code N times. If the number of SVs at the end of loop N is
# greater than (N-1)*delta at the end of loop 1, we've got a leak
}
leak(2,0,sub { !$^V }, '[perl #109762] version object in boolean context');
+
+
+# [perl #114356] run-time rexexp with unchanging pattern got
+# inflated refcounts
+
+leak(2, 0, sub { eval q{ my $x = "x"; "abc" =~ /$x/ for 1..5 } }, '#114356');