From: Doug MacEachern Date: Mon, 7 May 2001 09:50:58 +0000 (-0700) Subject: [patch] make hv_fetch{_ent} SvGMAGICAL aware X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b3a8ac67aa78993a17b8d3846555d51ac4e01cf;p=p5sagit%2Fp5-mst-13.2.git [patch] make hv_fetch{_ent} SvGMAGICAL aware Message-ID: p4raw-id: //depot/perl@10065 --- diff --git a/hv.c b/hv.c index 1b1e061..817d54d 100644 --- a/hv.c +++ b/hv.c @@ -163,7 +163,7 @@ Perl_hv_fetch(pTHX_ HV *hv, const char *key, I32 klen, I32 lval) } if (SvRMAGICAL(hv)) { - if (mg_find((SV*)hv,'P')) { + if (mg_find((SV*)hv,'P') || SvGMAGICAL((SV*)hv)) { sv = sv_newmortal(); mg_copy((SV*)hv, sv, key, klen); PL_hv_fetch_sv = sv; @@ -283,7 +283,7 @@ Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash) return 0; if (SvRMAGICAL(hv)) { - if (mg_find((SV*)hv,'P')) { + if (mg_find((SV*)hv,'P') || SvGMAGICAL((SV*)hv)) { sv = sv_newmortal(); keysv = sv_2mortal(newSVsv(keysv)); mg_copy((SV*)hv, sv, (char*)keysv, HEf_SVKEY); @@ -836,7 +836,7 @@ Perl_hv_exists(pTHX_ HV *hv, const char *key, I32 klen) } if (SvRMAGICAL(hv)) { - if (mg_find((SV*)hv,'P')) { + if (mg_find((SV*)hv,'P') || SvGMAGICAL((SV*)gv)) { sv = sv_newmortal(); mg_copy((SV*)hv, sv, key, klen); magic_existspack(sv, mg_find(sv, 'p')); @@ -926,7 +926,7 @@ Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash) return 0; if (SvRMAGICAL(hv)) { - if (mg_find((SV*)hv,'P')) { + if (mg_find((SV*)hv,'P') || SvGMAGICAL((SV*)hv)) { SV* svret = sv_newmortal(); sv = sv_newmortal(); keysv = sv_2mortal(newSVsv(keysv));