This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
the PAD_SET_CUR macro expanded too much for AIX compilers
authorDave Mitchell <davem@fdisolutions.com>
Fri, 1 Jul 2005 15:40:40 +0000 (15:40 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Fri, 1 Jul 2005 15:40:40 +0000 (15:40 +0000)
p4raw-id: //depot/perl@25042

pad.h
pp_ctl.c
pp_sort.c
pp_sys.c

diff --git a/pad.h b/pad.h
index b331cea..ce53b3b 100644 (file)
--- a/pad.h
+++ b/pad.h
@@ -103,7 +103,12 @@ Get the value from slot C<po> in the base (DEPTH=1) pad of a padlist
 
 =for apidoc m|void|PAD_SET_CUR |PADLIST padlist|I32 n
 Set the current pad to be pad C<n> in the padlist, saving
-the previous current pad.
+the previous current pad. NB currently this macro expands to a string too
+long for some compilers, so it's best to replace it with
+
+    SAVECOMPPAD();
+    PAD_SET_CUR_NOSAVE(padlist,n);
+
 
 =for apidoc m|void|PAD_SET_CUR_NOSAVE  |PADLIST padlist|I32 n
 like PAD_SET_CUR, but without the save
index 13a943c..40cf312 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1778,7 +1778,8 @@ PP(pp_dbstate)
        PUSHSUB_DB(cx);
        cx->blk_sub.retop = PL_op->op_next;
        CvDEPTH(cv)++;
-       PAD_SET_CUR(CvPADLIST(cv),1);
+       SAVECOMPPAD();
+       PAD_SET_CUR_NOSAVE(CvPADLIST(cv), 1);
        RETURNOP(CvSTART(cv));
     }
     else
@@ -2417,7 +2418,8 @@ PP(pp_goto)
                        sub_crush_depth(cv);
                    pad_push(padlist, CvDEPTH(cv));
                }
-               PAD_SET_CUR(padlist, CvDEPTH(cv));
+               SAVECOMPPAD();
+               PAD_SET_CUR_NOSAVE(padlist, CvDEPTH(cv));
                if (cx->blk_sub.hasargs)
                {
                    AV* av = (AV*)PAD_SVl(0);
index 59f975e..b605b02 100644 (file)
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1544,7 +1544,8 @@ PP(pp_sort)
                SAVEVPTR(CvROOT(cv)->op_ppaddr);
                CvROOT(cv)->op_ppaddr = PL_ppaddr[OP_NULL];
 
-               PAD_SET_CUR(CvPADLIST(cv), 1);
+               SAVECOMPPAD();
+               PAD_SET_CUR_NOSAVE(CvPADLIST(cv), 1);
             }
        }
     }
index 4f4be10..8cffb14 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1270,7 +1270,8 @@ S_doform(pTHX_ CV *cv, GV *gv, OP *retop)
     PUSHBLOCK(cx, CXt_FORMAT, PL_stack_sp);
     PUSHFORMAT(cx);
     cx->blk_sub.retop = retop;
-    PAD_SET_CUR(CvPADLIST(cv), 1);
+    SAVECOMPPAD();
+    PAD_SET_CUR_NOSAVE(CvPADLIST(cv), 1);
 
     setdefout(gv);         /* locally select filehandle so $% et al work */
     return CvSTART(cv);