X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pad.h;h=022a7de5829290a6125402750596e5b50f4ad920;hb=2ade63888e659bb60dd5fda64a79640b763ca351;hp=62d4fb1d3080fcc8161ed52ca9bd6c0e62ba22fb;hpb=4608196e45589eea5792cff92b551109899ddb06;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pad.h b/pad.h index 62d4fb1..022a7de 100644 --- a/pad.h +++ b/pad.h @@ -50,14 +50,20 @@ typedef enum { * whether PL_comppad and PL_curpad are consistent and whether they have * active values */ +#ifndef PERL_MAD +# define pad_peg(label) +#endif + #ifdef DEBUGGING # define ASSERT_CURPAD_LEGAL(label) \ + pad_peg(label); \ if (PL_comppad ? (AvARRAY(PL_comppad) != PL_curpad) : (PL_curpad != 0)) \ Perl_croak(aTHX_ "panic: illegal pad in %s: 0x%"UVxf"[0x%"UVxf"]",\ label, PTR2UV(PL_comppad), PTR2UV(PL_curpad)); # define ASSERT_CURPAD_ACTIVE(label) \ + pad_peg(label); \ if (!PL_comppad || (AvARRAY(PL_comppad) != PL_curpad)) \ Perl_croak(aTHX_ "panic: invalid pad in %s: 0x%"UVxf"[0x%"UVxf"]",\ label, PTR2UV(PL_comppad), PTR2UV(PL_curpad)); @@ -219,12 +225,14 @@ ling pad (lvalue) to C. Note that C is hijacked for this purpos */ #define PAD_COMPNAME_FLAGS(po) SvFLAGS(*av_fetch(PL_comppad_name, (po), FALSE)) +#define PAD_COMPNAME_FLAGS_isOUR(po) \ + ((PAD_COMPNAME_FLAGS(po) & (SVpad_NAME|SVpad_OUR)) == (SVpad_NAME|SVpad_OUR)) #define PAD_COMPNAME_PV(po) SvPV_nolen(*av_fetch(PL_comppad_name, (po), FALSE)) #define PAD_COMPNAME_TYPE(po) pad_compname_type(po) #define PAD_COMPNAME_OURSTASH(po) \ - (GvSTASH(*av_fetch(PL_comppad_name, (po), FALSE))) + (OURSTASH(*av_fetch(PL_comppad_name, (po), FALSE))) #define PAD_COMPNAME_GEN(po) SvCUR(AvARRAY(PL_comppad_name)[po])