by mortalising the temporary SVs.
or skip_all("XS::APItest not available");
}
-plan tests => 20;
+plan tests => 21;
# 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
my $tag = $+{tag};
}, "named regexp captures");
}
+
+leak(2,0,sub { !$^V }, '[perl #109762] version object in boolean context');
SP -= items;
if (sv_isobject(ST(0)) && sv_derived_from(ST(0), "version")) {
SV * const lobj = SvRV(ST(0));
- SV * const rs = newSViv( vcmp(lobj,new_version(newSVpvs("0"))) );
+ SV * const rs =
+ newSViv( vcmp(lobj,
+ sv_2mortal(new_version(
+ sv_2mortal(newSVpvs("0"))
+ ))
+ )
+ );
mPUSHs(rs);
PUTBACK;
return;