From: Nicholas Clark Date: Sun, 20 Jan 2008 17:39:22 +0000 (+0000) Subject: Fix (probable) bug-by-inspection - CxREALEVAL(), CxTRYBLOCK(), X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0588a1501b88b68a0cd58bf7f47f7a5bef1e3c30;p=p5sagit%2Fp5-mst-13.2.git 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 --- 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()))