add missing file from change#1943
[p5sagit/p5-mst-13.2.git] / cop.h
diff --git a/cop.h b/cop.h
index aaa5720..98ae91f 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -15,6 +15,7 @@ struct cop {
     U32                cop_seq;        /* parse sequence number */
     I32                cop_arybase;    /* array base this line was compiled with */
     line_t      cop_line;       /* line # of this command */
+    SV *       cop_warnings;   /* lexical warnings bitmask */
 };
 
 #define Nullcop Null(COP*)
@@ -93,7 +94,7 @@ struct block_eval {
 
 #define PUSHEVAL(cx,n,fgv)                                             \
        cx->blk_eval.old_in_eval = PL_in_eval;                          \
-       cx->blk_eval.old_op_type = op->op_type;                         \
+       cx->blk_eval.old_op_type = PL_op->op_type;                              \
        cx->blk_eval.old_name = n;                                      \
        cx->blk_eval.old_eval_root = PL_eval_root;                              \
        cx->blk_eval.cur_text = PL_linestr;
@@ -142,7 +143,7 @@ struct block_loop {
 #define POPLOOP2()                                                     \
        SvREFCNT_dec(cxloop.iterlval);                                  \
        if (cxloop.itervar) {                                           \
-           SvREFCNT_dec(*cxloop.itervar);                              \
+           sv_2mortal(*cxloop.itervar);                                \
            *cxloop.itervar = cxloop.itersave;                          \
        }                                                               \
        if (cxloop.iterary && cxloop.iterary != PL_curstack)            \
@@ -198,7 +199,7 @@ struct block {
        pm               = cx->blk_oldpm,                               \
        gimme            = cx->blk_gimme;                               \
        DEBUG_l( PerlIO_printf(PerlIO_stderr(), "Leaving block %ld, type %s\n",         \
-                   (long)cxstack_ix+1,block_type[cx->cx_type]); )
+                   (long)cxstack_ix+1,block_type[CxTYPE(cx)]); )
 
 /* Continue a block elsewhere (NEXT and REDO). */
 #define TOPBLOCK(cx) cx  = &cxstack[cxstack_ix],                       \
@@ -261,12 +262,14 @@ struct subst {
        rxres_free(&cx->sb_rxres)
 
 struct context {
-    I32                cx_type;        /* what kind of context this is */
+    U32                cx_type;        /* what kind of context this is */
     union {
        struct block    cx_blk;
        struct subst    cx_subst;
     } cx_u;
 };
+
+#define CXTYPEMASK     0xff
 #define CXt_NULL       0
 #define CXt_SUB                1
 #define CXt_EVAL       2
@@ -274,6 +277,12 @@ struct context {
 #define CXt_SUBST      4
 #define CXt_BLOCK      5
 
+/* private flags for CXt_EVAL */
+#define CXp_REAL       0x00000100      /* truly eval'', not a lookalike */
+
+#define CxTYPE(c)      ((c)->cx_type & CXTYPEMASK)
+#define CxREALEVAL(c)  (((c)->cx_type & (CXt_EVAL|CXp_REAL)) == (CXt_EVAL|CXp_REAL))
+
 #define CXINC (cxstack_ix < cxstack_max ? ++cxstack_ix : (cxstack_ix = cxinc()))
 
 /* "gimme" values */