summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-23 17:04:42 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-23 17:04:56 -0700
commit31f1461f4bbbc0db195fcb42708a5e4340d7eee0 (patch)
tree09521277ec53c365b52e4f01ed8551baa3fe5c6c /sv.c
parent52e96e24558c7565ebbef0d0c5fc53f9863bd154 (diff)
downloadperl-31f1461f4bbbc0db195fcb42708a5e4340d7eee0.tar.gz
sv_setsv_flags was also using a potentially freed HV
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index a091bf00d0..a42452aa14 100644
--- a/sv.c
+++ b/sv.c
@@ -4033,7 +4033,11 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV* sstr, const I32 flags)
if (len > 1 && name[len-2] == ':' && name[len-1] == ':') {
/* Set aside the old stash, so we can reset isa caches
on its subclasses. */
- old_stash = GvHV(dstr);
+ if((old_stash = GvHV(dstr)));
+ /* Make sure we do not lose it early. */
+ SvREFCNT_inc_simple_void_NN(
+ sv_2mortal((SV *)old_stash)
+ );
reset_isa = TRUE;
}