From fbb889c85e79da0c4f54a617b00e93f8c46a9bea Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Sat, 11 Jun 2011 13:29:54 -0300 Subject: Added a flags parameter to pad_findlex. --- embed.fnc | 2 +- embed.h | 2 +- pad.c | 16 ++++++++-------- proto.h | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/embed.fnc b/embed.fnc index efb9d08897..925eee7a48 100644 --- a/embed.fnc +++ b/embed.fnc @@ -2141,7 +2141,7 @@ ApdR |PADOFFSET|pad_findmy_sv|NN SV* name|U32 flags ApdD |PADOFFSET|find_rundefsvoffset | Apd |SV* |find_rundefsv | #if defined(PERL_IN_PAD_C) -sd |PADOFFSET|pad_findlex |NN const char *namepv|STRLEN namelen\ +sd |PADOFFSET|pad_findlex |NN const char *namepv|STRLEN namelen|U32 flags \ |NN const CV* cv|U32 seq|int warn \ |NULLOK SV** out_capture|NN SV** out_name_sv \ |NN int *out_flags diff --git a/embed.h b/embed.h index 6a828dbb92..750c0da68d 100644 --- a/embed.h +++ b/embed.h @@ -1368,7 +1368,7 @@ # if defined(PERL_IN_PAD_C) #define pad_alloc_name(a,b,c,d) S_pad_alloc_name(aTHX_ a,b,c,d) #define pad_check_dup(a,b,c) S_pad_check_dup(aTHX_ a,b,c) -#define pad_findlex(a,b,c,d,e,f,g,h) S_pad_findlex(aTHX_ a,b,c,d,e,f,g,h) +#define pad_findlex(a,b,c,d,e,f,g,h,i) S_pad_findlex(aTHX_ a,b,c,d,e,f,g,h,i) #define pad_reset() S_pad_reset(aTHX) # endif # if defined(PERL_IN_PERL_C) diff --git a/pad.c b/pad.c index c35d0a6448..afdc8086bb 100644 --- a/pad.c +++ b/pad.c @@ -817,8 +817,8 @@ Perl_pad_findmy_pvn(pTHX_ const char *namepv, STRLEN namelen, U32 flags) Perl_croak(aTHX_ "panic: pad_findmy_pvn illegal flag bits 0x%" UVxf, (UV)flags); - offset = pad_findlex(namepv, namelen, PL_compcv, PL_cop_seqmax, 1, - NULL, &out_sv, &out_flags); + offset = pad_findlex(namepv, namelen, flags, + PL_compcv, PL_cop_seqmax, 1, NULL, &out_sv, &out_flags); if ((PADOFFSET)offset != NOT_IN_PAD) return offset; @@ -895,7 +895,7 @@ Perl_find_rundefsvoffset(pTHX) dVAR; SV *out_sv; int out_flags; - return pad_findlex("$_", 2, find_runcv(NULL), PL_curcop->cop_seq, 1, + return pad_findlex("$_", 2, 0, find_runcv(NULL), PL_curcop->cop_seq, 1, NULL, &out_sv, &out_flags); } @@ -916,7 +916,7 @@ Perl_find_rundefsv(pTHX) int flags; PADOFFSET po; - po = pad_findlex("$_", 2, find_runcv(NULL), PL_curcop->cop_seq, 1, + po = pad_findlex("$_", 2, 0, find_runcv(NULL), PL_curcop->cop_seq, 1, NULL, &namesv, &flags); if (po == NOT_IN_PAD || SvPAD_OUR(namesv)) @@ -926,7 +926,7 @@ Perl_find_rundefsv(pTHX) } /* -=for apidoc m|PADOFFSET|pad_findlex|const char *namepv|STRLEN namelen|const CV* cv|U32 seq|int warn|SV** out_capture|SV** out_name_sv|int *out_flags +=for apidoc m|PADOFFSET|pad_findlex|const char *namepv|STRLEN namelen|U32 flags|const CV* cv|U32 seq|int warn|SV** out_capture|SV** out_name_sv|int *out_flags Find a named lexical anywhere in a chain of nested pads. Add fake entries in the inner pads if it's found in an outer one. @@ -957,7 +957,7 @@ the parent pad. STATIC PADOFFSET -S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, const CV* cv, U32 seq, +S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags) { dVAR; @@ -1097,7 +1097,7 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, const CV* cv, U32 seq, "Pad findlex cv=0x%"UVxf" chasing lex in outer pad\n", PTR2UV(cv))); n = *out_name_sv; - (void) pad_findlex(namepv, namelen, CvOUTSIDE(cv), + (void) pad_findlex(namepv, namelen, flags, CvOUTSIDE(cv), CvOUTSIDE_SEQ(cv), newwarn, out_capture, out_name_sv, out_flags); *out_name_sv = n; @@ -1143,7 +1143,7 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, const CV* cv, U32 seq, new_capturep = out_capture ? out_capture : CvLATE(cv) ? NULL : &new_capture; - offset = pad_findlex(namepv, namelen, CvOUTSIDE(cv), CvOUTSIDE_SEQ(cv), 1, + offset = pad_findlex(namepv, namelen, flags, CvOUTSIDE(cv), CvOUTSIDE_SEQ(cv), 1, new_capturep, out_name_sv, out_flags); if ((PADOFFSET)offset == NOT_IN_PAD) return NOT_IN_PAD; diff --git a/proto.h b/proto.h index 343d9a7d43..2164152998 100644 --- a/proto.h +++ b/proto.h @@ -5626,11 +5626,11 @@ STATIC void S_pad_check_dup(pTHX_ SV *name, U32 flags, const HV *ourstash) #define PERL_ARGS_ASSERT_PAD_CHECK_DUP \ assert(name) -STATIC PADOFFSET S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags) +STATIC PADOFFSET S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags) __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_3) - __attribute__nonnull__(pTHX_7) - __attribute__nonnull__(pTHX_8); + __attribute__nonnull__(pTHX_4) + __attribute__nonnull__(pTHX_8) + __attribute__nonnull__(pTHX_9); #define PERL_ARGS_ASSERT_PAD_FINDLEX \ assert(namepv); assert(cv); assert(out_name_sv); assert(out_flags) -- cgit v1.2.1