This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Extend PUSHFORMAT() to take a second parameter to set retop, to save
authorNicholas Clark <nick@ccl4.org>
Sun, 20 Jan 2008 18:03:27 +0000 (18:03 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 20 Jan 2008 18:03:27 +0000 (18:03 +0000)
NULLing it and then reassigning.

p4raw-id: //depot/perl@33012

cop.h
pp_sys.c

diff --git a/cop.h b/cop.h
index 21aeb22..5c80173 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -322,10 +322,10 @@ struct block_sub {
        cx->blk_sub.lval = 0;
 
 
-#define PUSHFORMAT(cx)                                                 \
+#define PUSHFORMAT(cx, retop)                                          \
        cx->blk_sub.cv = cv;                                            \
        cx->blk_sub.gv = gv;                                            \
-       cx->blk_sub.retop = NULL;                                       \
+       cx->blk_sub.retop = (retop);                                    \
        cx->blk_sub.hasargs = 0;                                        \
        cx->blk_sub.dfoutgv = PL_defoutgv;                              \
        SvREFCNT_inc_void(cx->blk_sub.dfoutgv)
index da07e46..b8fa1a9 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1244,8 +1244,7 @@ S_doform(pTHX_ CV *cv, GV *gv, OP *retop)
     SAVETMPS;
 
     PUSHBLOCK(cx, CXt_FORMAT, PL_stack_sp);
-    PUSHFORMAT(cx);
-    cx->blk_sub.retop = retop;
+    PUSHFORMAT(cx, retop);
     SAVECOMPPAD();
     PAD_SET_CUR_NOSAVE(CvPADLIST(cv), 1);