]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - indirect.xs
Stop leaking the package name passed to the hook
[perl/modules/indirect.git] / indirect.xs
index 4f1deb4d69937ce96ffd5e372f2866101bc94fc5..896ae7f591338b40e75a0d06e33940aea9af135c 100644 (file)
@@ -516,24 +516,24 @@ STATIC OP *indirect_ck_entersub(pTHX_ OP *o) {
   if (mpos < opos) {
    SV *code = indirect_detag(hint);
 
-   if (hint) {
+   if (code) {
     SV     *file;
     line_t  line;
     dSP;
 
+    ENTER;
+    SAVETMPS;
+
     onamesv = sv_mortalcopy(onamesv);
     mnamesv = sv_mortalcopy(mnamesv);
 
 #ifdef USE_ITHREADS
-    file = newSVpv(CopFILE(&PL_compiling), 0);
+    file = sv_2mortal(newSVpv(CopFILE(&PL_compiling), 0));
 #else
     file = sv_mortalcopy(CopFILESV(&PL_compiling));
 #endif
     line = CopLINE(&PL_compiling);
 
-    ENTER;
-    SAVETMPS;
-
     PUSHMARK(SP);
     EXTEND(SP, 4);
     PUSHs(onamesv);