This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
doop.c: (Coverity) found a bug but not quite what Coverity thought it did (try valgri...
[perl5.git] / cc_runtime.h
index fe830c0..cb8c4ca 100644 (file)
@@ -1,4 +1,14 @@
-#define DOOP(ppname) PUTBACK; op = ppname(ARGS); SPAGAIN
+/*    cc_runtime.h
+ *
+ *    Copyright (C) 1999, 2000, 2001, by Larry Wall and others
+ *
+ *    You may distribute under the terms of either the GNU General Public
+ *    License or the Artistic License, as specified in the README file.
+ *
+ */
+
+#define DOOP(ppname) PUTBACK; PL_op = ppname(aTHX); SPAGAIN
+#define CCPP(s)   OP * s(pTHX)
 
 #define PP_LIST(g) do {                        \
        dMARK;                          \
            if (++MARK <= SP)           \
                *MARK = *SP;            \
            else                        \
-               *MARK = &sv_undef;      \
+               *MARK = &PL_sv_undef;   \
            SP = MARK;                  \
        }                               \
    } while (0)
 
 #define MAYBE_TAINT_SASSIGN_SRC(sv) \
-    if (tainting && tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \
-                                !((mg=mg_find(left, 't')) && mg->mg_len & 1)))\
+    if (PL_tainting && PL_tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \
+        !((mg=mg_find(left, PERL_MAGIC_taint)) && mg->mg_len & 1)))\
         TAINT_NOT
 
 #define PP_PREINC(sv) do {     \
@@ -28,9 +38,9 @@
 
 #define PP_UNSTACK do {                \
        TAINT_NOT;              \
-       stack_sp = stack_base + cxstack[cxstack_ix].blk_oldsp;  \
+       PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;    \
        FREETMPS;               \
-       oldsave = scopestack[scopestack_ix - 1]; \
+       oldsave = PL_scopestack[PL_scopestack_ix - 1]; \
        LEAVE_SCOPE(oldsave);   \
        SPAGAIN;                \
     } while(0)
        JMPENV_PUSH(ret);                       \
        switch (ret) {                          \
        case 0:                                 \
-           op = ppaddr(ARGS);                  \
-           retstack[retstack_ix - 1] = Nullop; \
-           if (op != nxt) runops();            \
+           PL_op = ppaddr(aTHX);               \
+           if (PL_op != nxt) CALLRUNOPS();     \
            JMPENV_POP;                         \
            break;                              \
        case 1: JMPENV_POP; JMPENV_JUMP(1);     \
        case 2: JMPENV_POP; JMPENV_JUMP(2);     \
        case 3:                                 \
            JMPENV_POP;                         \
-           if (restartop != nxt)               \
+           if (PL_restartop && PL_restartop != nxt)            \
                JMPENV_JUMP(3);                 \
        }                                       \
-       op = nxt;                               \
+       PL_op = nxt;                            \
        SPAGAIN;                                \
     } while (0)
 
-#define PP_ENTERTRY(jmpbuf,label) do {         \
-       dJMPENV;                                \
-       int ret;                                \
-       JMPENV_PUSH(ret);                       \
-       switch (ret) {                          \
-       case 1: JMPENV_POP; JMPENV_JUMP(1);     \
-       case 2: JMPENV_POP; JMPENV_JUMP(2);     \
-       case 3: JMPENV_POP; SPAGAIN; goto label;\
-       }                                       \
-    } while (0)
+
+#define PP_ENTERTRY(jmpbuf,label)  \
+       STMT_START {                    \
+               int ret;                \
+               JMPENV_PUSH_ENV(jmpbuf,ret);                    \
+               switch (ret) {                          \
+                       case 1: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(1);\
+                       case 2: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(2);\
+                       case 3: JMPENV_POP_ENV(jmpbuf); SPAGAIN; goto label;\
+               }                                       \
+       } STMT_END
+#define PP_LEAVETRY \
+       STMT_START{ PL_top_env=PL_top_env->je_prev; }STMT_END