summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-11 09:59:15 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-11 09:59:15 +0000
commitcbc4ed9afe9ba8f26ad722a8ad1bb783a1771a4a (patch)
tree1dcfb6ca7fe70493f7cbbcf7fd9c7bbe927a5c97 /hv.c
parentdba3f186d8c869e7d758c2fbacce9612063a3e15 (diff)
downloadperl-cbc4ed9afe9ba8f26ad722a8ad1bb783a1771a4a.tar.gz
Fix aliasing to an non-existent element of %+
(by Yves Orton) p4raw-id: //depot/perl@28995
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hv.c b/hv.c
index 14320773b0..e482d569e7 100644
--- a/hv.c
+++ b/hv.c
@@ -467,10 +467,8 @@ S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
}
if (regdata) {
sv = Perl_reg_named_buff_sv(aTHX_ keysv);
- if (!sv) {
- SvREFCNT_dec(keysv);
- return 0;
- }
+ if (!sv)
+ sv = sv_newmortal();
} else {
sv = sv_newmortal();
mg_copy((SV*)hv, sv, (char *)keysv, HEf_SVKEY);