X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=indirect.xs;h=b9314ae60a2e92298ff50c63a2c8029373f93a5c;hb=cfbd22399e253cbac1aad5436d2b191082befe14;hp=6203d97a4d74679471f6e733771c711aa63c5c2c;hpb=0df47659c67c30deca9fc06d6c7643a886ddb7d8;p=perl%2Fmodules%2Findirect.git diff --git a/indirect.xs b/indirect.xs index 6203d97..b9314ae 100644 --- a/indirect.xs +++ b/indirect.xs @@ -35,6 +35,10 @@ # define sv_catpvn_nomg sv_catpvn #endif +#ifndef mPUSHu +# define mPUSHu(U) PUSHs(sv_2mortal(newSVuv(U))) +#endif + #ifndef HvNAME_get # define HvNAME_get(H) HvNAME(H) #endif @@ -292,6 +296,7 @@ STATIC void indirect_map_store(pTHX_ const OP *o, const char *src, SV *sv) { SvUVX(val) = PTR2UV(src); SvIOK_on(val); SvIsUV_on(val); + SvREADONLY_on(val); ptable_store(MY_CXT.map, o, val); } @@ -512,15 +517,29 @@ STATIC OP *indirect_ck_entersub(pTHX_ OP *o) { SV *code = indirect_detag(hint); if (hint) { + SV *file; + line_t line; dSP; + onamesv = sv_mortalcopy(onamesv); + mnamesv = sv_mortalcopy(mnamesv); + +#ifdef USE_ITHREADS + file = newSVpv(CopFILE(&PL_compiling), 0); +#else + file = sv_mortalcopy(CopFILESV(&PL_compiling)); +#endif + line = CopLINE(&PL_compiling); + ENTER; SAVETMPS; PUSHMARK(SP); - EXTEND(SP, 2); + EXTEND(SP, 4); PUSHs(onamesv); PUSHs(mnamesv); + PUSHs(file); + mPUSHu(line); PUTBACK; call_sv(code, G_VOID);