This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
52e96e2
)
sv_setsv_flags was also using a potentially freed HV
author
Father Chrysostomos
<sprout@cpan.org>
Sun, 24 Oct 2010 00:04:42 +0000
(17:04 -0700)
committer
Father Chrysostomos
<sprout@cpan.org>
Sun, 24 Oct 2010 00:04:56 +0000
(17:04 -0700)
sv.c
patch
|
blob
|
blame
|
history
diff --git
a/sv.c
b/sv.c
index
a091bf0
..
a42452a
100644
(file)
--- 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;
}