diff options
author | Doug MacEachern <dougm@covalent.net> | 2001-05-07 02:50:58 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-10 01:30:43 +0000 |
commit | 7b3a8ac67aa78993a17b8d3846555d51ac4e01cf (patch) | |
tree | 87848b107aece053ca754e48e2b1e8a908c7d248 /hv.c | |
parent | c495e72806088f6eabb02dba2a1fcfd54076b581 (diff) | |
download | perl-7b3a8ac67aa78993a17b8d3846555d51ac4e01cf.tar.gz |
[patch] make hv_fetch{_ent} SvGMAGICAL aware
Message-ID: <Pine.LNX.4.21.0105070947060.23808-100000@mako.covalent.net>
p4raw-id: //depot/perl@10065
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)); |