summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2002-05-04 01:34:18 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-06 13:13:00 +0000
commitc39e6ab0a7545b7ae425e21f045aa689291b268e (patch)
treea66b15f7fe920bd9109a3291f8a347a43a0d213e /pp_hot.c
parent2c74c289a09a24de36af47eb52526438ffa7fdd6 (diff)
downloadperl-c39e6ab0a7545b7ae425e21f045aa689291b268e.tar.gz
[proposed PATCH] correctly unlocalise exists on tied/%ENV
Message-ID: <20020504003418.F22026@fdgroup.com> p4raw-id: //depot/perl@16431
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 30653a76b7..f2387b4ce0 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1644,7 +1644,12 @@ PP(pp_helem)
if (SvTYPE(hv) == SVt_PVHV) {
if (PL_op->op_private & OPpLVAL_INTRO)
- preeminent = SvRMAGICAL(hv) ? 1 : hv_exists_ent(hv, keysv, 0);
+ preeminent =
+ ( SvRMAGICAL(hv)
+ && !mg_find((SV*)hv, PERL_MAGIC_tied)
+ && !mg_find((SV*)hv, PERL_MAGIC_env)
+ ) ? 1 : hv_exists_ent(hv, keysv, 0);
+
he = hv_fetch_ent(hv, keysv, lval && !defer, hash);
svp = he ? &HeVAL(he) : 0;
}