From 0588a1501b88b68a0cd58bf7f47f7a5bef1e3c30 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 20 Jan 2008 17:39:22 +0000 Subject: [PATCH] Fix (probable) bug-by-inspection - CxREALEVAL(), CxTRYBLOCK(), CxFOREACH() and CxFOREACHDEF() should all be masking against CXTYPEMASK rather than their own type number. p4raw-id: //depot/perl@33011 --- cop.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cop.h b/cop.h index d8c4961..21aeb22 100644 --- a/cop.h +++ b/cop.h @@ -677,13 +677,13 @@ struct context { #define CxTYPE(c) ((c)->cx_type & CXTYPEMASK) #define CxMULTICALL(c) (((c)->cx_type & CXp_MULTICALL) \ == CXp_MULTICALL) -#define CxREALEVAL(c) (((c)->cx_type & (CXt_EVAL|CXp_REAL)) \ +#define CxREALEVAL(c) (((c)->cx_type & (CXTYPEMASK|CXp_REAL)) \ == (CXt_EVAL|CXp_REAL)) -#define CxTRYBLOCK(c) (((c)->cx_type & (CXt_EVAL|CXp_TRYBLOCK)) \ +#define CxTRYBLOCK(c) (((c)->cx_type & (CXTYPEMASK|CXp_TRYBLOCK)) \ == (CXt_EVAL|CXp_TRYBLOCK)) -#define CxFOREACH(c) (((c)->cx_type & (CXt_LOOP|CXp_FOREACH)) \ +#define CxFOREACH(c) (((c)->cx_type & (CXTYPEMASK|CXp_FOREACH)) \ == (CXt_LOOP|CXp_FOREACH)) -#define CxFOREACHDEF(c) (((c)->cx_type & (CXt_LOOP|CXp_FOREACH|CXp_FOR_DEF))\ +#define CxFOREACHDEF(c) (((c)->cx_type & (CXTYPEMASK|CXp_FOREACH|CXp_FOR_DEF))\ == (CXt_LOOP|CXp_FOREACH|CXp_FOR_DEF)) #define CXINC (cxstack_ix < cxstack_max ? ++cxstack_ix : (cxstack_ix = cxinc())) -- 1.8.3.1