From bf01568a4bfab00fb5180c6b243ef3c90ca3ebd6 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 23 Oct 2010 09:48:31 -0700 Subject: S_glob_assign_glob was using a potentially freed HV --- sv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sv.c b/sv.c index 8db10dc779..a091bf00d0 100644 --- a/sv.c +++ b/sv.c @@ -3629,7 +3629,11 @@ S_glob_assign_glob(pTHX_ SV *const dstr, SV *const sstr, const int dtype) /* 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) + ); } } } -- cgit v1.2.1