diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-06-02 06:07:53 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-06-02 06:07:53 +0000 |
commit | e1f795dc699c88c2d9eb4a46fe629483760393c2 (patch) | |
tree | b441815162375621cd823107a2da6a026bd2ce1e /pad.c | |
parent | 533968fe05e828818d78b731fade41cae15a5f2a (diff) | |
download | perl-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.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |