summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-06-02 06:07:53 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-06-02 06:07:53 +0000
commite1f795dc699c88c2d9eb4a46fe629483760393c2 (patch)
treeb441815162375621cd823107a2da6a026bd2ce1e /pad.c
parent533968fe05e828818d78b731fade41cae15a5f2a (diff)
downloadperl-e1f795dc699c88c2d9eb4a46fe629483760393c2.tar.gz
Make the dUNDERBAR/UNDERBAR macros work as advertised.
While we're at it, use the same trick to make reverse() work correctly with lexical $_. p4raw-id: //depot/perl@22889
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pad.c b/pad.c
index d7799c97a6..0b0491c640 100644
--- a/pad.c
+++ b/pad.c
@@ -582,6 +582,19 @@ Perl_pad_findmy(pTHX_ char *name)
return NOT_IN_PAD;
}
+/*
+ * Returns the offset of a lexical $_, if there is one, at run time.
+ * Used by the UNDERBAR XS macro.
+ */
+
+PADOFFSET
+Perl_find_rundefsvoffset()
+{
+ SV *out_sv;
+ int out_flags;
+ return pad_findlex("$_", find_runcv(NULL), PL_curcop->cop_seq, 1,
+ Null(SV**), &out_sv, &out_flags);
+}
/*
=for apidoc pad_findlex