summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-04-07 11:00:41 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2003-04-19 07:06:13 +0000
commitdd28f7bb7eebdb0b562c940b3c4f89457e829ea6 (patch)
treefee71493033bb3c2057e0c4b474527a3abcfe7b1 /av.c
parentbfe0b8460c5710ac333ad9f60968a82600193679 (diff)
downloadperl-dd28f7bb7eebdb0b562c940b3c4f89457e829ea6.tar.gz
allow recursive FETCHes
Message-ID: <20030407100041.A1617@fdgroup.com> p4raw-id: //depot/perl@19268
Diffstat (limited to 'av.c')
-rw-r--r--av.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/av.c b/av.c
index 8fb22d32f5..d37ba01c01 100644
--- a/av.c
+++ b/av.c
@@ -209,9 +209,11 @@ Perl_av_fetch(pTHX_ register AV *av, I32 key, I32 lval)
}
sv = sv_newmortal();
- mg_copy((SV*)av, sv, 0, key);
- PL_av_fetch_sv = sv;
- return &PL_av_fetch_sv;
+ sv_upgrade(sv, SVt_PVLV);
+ mg_copy((SV*)av, sv, 0, key);
+ LvTYPE(sv) = 't';
+ LvTARG(sv) = sv; /* fake (SV**) */
+ return &(LvTARG(sv));
}
}