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
(parent:
9ef5ed9
)
Nicholas says that SvREFCNT_dec should be sufficient here
author
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Sat, 30 May 2009 14:40:03 +0000
(16:40 +0200)
committer
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Sat, 30 May 2009 14:40:03 +0000
(16:40 +0200)
(instead of marking the SV as mortal.)
hv.c
patch
|
blob
|
blame
|
history
diff --git
a/hv.c
b/hv.c
index
79d1944
..
3322848
100644
(file)
--- a/
hv.c
+++ b/
hv.c
@@
-1443,8
+1443,10
@@
Perl_hv_copy_hints_hv(pTHX_ HV *const ohv)
hv_iterinit(ohv);
while ((entry = hv_iternext_flags(ohv, 0))) {
SV *const sv = newSVsv(HeVAL(entry));
+ SV *heksv = newSVhek(HeKEY_hek(entry));
sv_magic(sv, NULL, PERL_MAGIC_hintselem,
- (char *)sv_2mortal(newSVhek (HeKEY_hek(entry))), HEf_SVKEY);
+ (char *)heksv, HEf_SVKEY);
+ SvREFCNT_dec(heksv);
(void)hv_store_flags(hv, HeKEY(entry), HeKLEN(entry),
sv, HeHASH(entry), HeKFLAGS(entry));
}