summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regcomp.c4
-rw-r--r--t/op/svleak.t2
2 files changed, 5 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index f6391168f8..e98bf34c4b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -11573,9 +11573,13 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
while (isALNUM(*s))
s++;
if (*s && c == *s && s[1] == ']') {
+ SAVEFREESV(RExC_rx_sv);
+ SAVEFREESV(listsv);
ckWARN3reg(s+2,
"POSIX syntax [%c %c] belongs inside character classes",
c, c);
+ ReREFCNT_inc(RExC_rx_sv);
+ SvREFCNT_inc_simple_void_NN(listsv);
}
}
diff --git a/t/op/svleak.t b/t/op/svleak.t
index ad67259252..129ad0591a 100644
--- a/t/op/svleak.t
+++ b/t/op/svleak.t
@@ -101,8 +101,8 @@ eleak(2, 0, "$f 'closure';
eleak(2, 0, "$all /(?{})?/ ", '(?{})? with fatal warnings');
eleak(2, 0, "$all /(?{})+/ ", '(?{})+ with fatal warnings');
eleak(2, 0, "$all /[\\i]/ ", 'invalid charclass escape with fatal warns');
-$::TODO = 'still leaks';
eleak(2, 0, "$all /[:foo:]/ ", '/[:foo:]/ with fatal warnings');
+$::TODO = 'still leaks';
eleak(2, 0, "$all /[a-\\d]/ ", '[a-\d] char class with fatal warnings');
eleak(2, 0, "$all v111111111111111111111111111111111111111111111111",
'vstring num overflow with fatal warnings');