summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorRobert Spier <rspier@pobox.com>2001-03-08 22:30:20 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-09 15:01:27 +0000
commit62815d3c8d96cc000ba7b7782a9f95afd54ffe44 (patch)
treedb36505ed66520a5fe2a14fcbabb5119ff9e8cb5 /hv.c
parentad52c9ebd1217cdd30d8a5568b46bfab6236a484 (diff)
downloadperl-62815d3c8d96cc000ba7b7782a9f95afd54ffe44.tar.gz
Re: [ID 19990808.001] [PATCH] FETCH triggered on exists()
Message-ID: <15016.38044.381174.160189@rls.cx> EXISTS() returning undef mistakenly triggered a FETCH(). p4raw-id: //depot/perl@9090
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hv.c b/hv.c
index a4951f83c3..f25aea2d99 100644
--- a/hv.c
+++ b/hv.c
@@ -927,11 +927,12 @@ Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)
if (SvRMAGICAL(hv)) {
if (mg_find((SV*)hv,'P')) {
+ SV* svret = sv_newmortal();
sv = sv_newmortal();
keysv = sv_2mortal(newSVsv(keysv));
mg_copy((SV*)hv, sv, (char*)keysv, HEf_SVKEY);
- magic_existspack(sv, mg_find(sv, 'p'));
- return SvTRUE(sv);
+ magic_existspack(svret, mg_find(sv, 'p'));
+ return SvTRUE(svret);
}
#ifdef ENV_IS_CASELESS
else if (mg_find((SV*)hv,'E')) {