This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
the monster cpp expression needs to be on one line to
[perl5.git] / cop.h
diff --git a/cop.h b/cop.h
index 5760a8d..2f1f676 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -1,6 +1,6 @@
 /*    cop.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -149,23 +149,28 @@ struct block_sub {
 struct block_eval {
     I32                old_in_eval;
     I32                old_op_type;
-    char *     old_name;
+    SV *       old_namesv;
     OP *       old_eval_root;
     SV *       cur_text;
 };
 
 #define PUSHEVAL(cx,n,fgv)                                             \
+    STMT_START {                                                       \
        cx->blk_eval.old_in_eval = PL_in_eval;                          \
        cx->blk_eval.old_op_type = PL_op->op_type;                      \
-       cx->blk_eval.old_name = (n ? savepv(n) : Nullch);               \
+       cx->blk_eval.old_namesv = (n ? newSVpv(n,0) : Nullsv);          \
        cx->blk_eval.old_eval_root = PL_eval_root;                      \
-       cx->blk_eval.cur_text = PL_linestr;
+       cx->blk_eval.cur_text = PL_linestr;                             \
+    } STMT_END
 
 #define POPEVAL(cx)                                                    \
+    STMT_START {                                                       \
        PL_in_eval = cx->blk_eval.old_in_eval;                          \
        optype = cx->blk_eval.old_op_type;                              \
        PL_eval_root = cx->blk_eval.old_eval_root;                      \
-       Safefree(cx->blk_eval.old_name);
+       if (cx->blk_eval.old_namesv)                                    \
+           sv_2mortal(cx->blk_eval.old_namesv);                        \
+    } STMT_END
 
 /* loop context */
 struct block_loop {
@@ -194,12 +199,12 @@ struct block_loop {
            : &GvSV((GV*)(c)->blk_loop.iterdata))                       \
         : (SV**)NULL)
 #  define CX_ITERDATA_SET(cx,idata)                                    \
-       if (cx->blk_loop.iterdata = (idata))                            \
+       if ((cx->blk_loop.iterdata = (idata)))                          \
            cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));
 #else
 #  define CxITERVAR(c)         ((c)->blk_loop.itervar)
 #  define CX_ITERDATA_SET(cx,ivar)                                     \
-       if (cx->blk_loop.itervar = (SV**)(ivar))                        \
+       if ((cx->blk_loop.itervar = (SV**)(ivar)))                      \
            cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));
 #endif