diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-24 12:50:32 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-24 12:50:32 +0000 |
commit | c6fdafd0fef3b735d3a7b9441840698d27fe4e6b (patch) | |
tree | 908c7569373a36970a0c8fe3311798a60b514fe4 /cop.h | |
parent | 8b73ab1881b775e12ace39efe757716ab526e9db (diff) | |
download | perl-c6fdafd0fef3b735d3a7b9441840698d27fe4e6b.tar.gz |
Change the context type of for ($a .. $b) to CXt_LOOP_LAZYIV, and
assert that it isn't using cx->blk_loop.iterlval.
Fix a casting bug when assigning a sentinal to cx->blk_loop.iterary.
p4raw-id: //depot/perl@33061
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -518,6 +518,8 @@ struct block_loop { CX_ITERDATA_SET(cx,dat); #define POPLOOP(cx) \ + if (CxTYPE(cx) == CXt_LOOP_LAZYIV) \ + assert(!cx->blk_loop.iterlval); \ SvREFCNT_dec(cx->blk_loop.iterlval); \ if (CxITERVAR(cx)) { \ if (SvPADMY(cx->blk_loop.itersave)) { \ @@ -679,11 +681,12 @@ struct context { #define CXt_BLOCK 5 #define CXt_FORMAT 6 #define CXt_GIVEN 7 -#define CXt_LOOP_PLAIN 8 -#define CXt_LOOP_FOR 9 +/* This is first so that CXt_LOOP_FOR|CXt_LOOP_LAZYIV is CXt_LOOP_LAZYIV */ +#define CXt_LOOP_FOR 8 +#define CXt_LOOP_PLAIN 9 /* Foreach on a temporary list on the stack */ #define CXt_LOOP_STACK 10 -#define CXt_LOOP_RES2 11 +#define CXt_LOOP_LAZYIV 11 /* private flags for CXt_SUB and CXt_NULL However, this is checked in many places which do not check the type, so |