From: Robert Spier Date: Fri, 9 Mar 2001 03:30:20 +0000 (-0500) Subject: Re: [ID 19990808.001] [PATCH] FETCH triggered on exists() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=62815d3c8d96cc000ba7b7782a9f95afd54ffe44;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/hv.c b/hv.c index a4951f8..f25aea2 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')) {