summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-24 12:50:32 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-24 12:50:32 +0000
commitc6fdafd0fef3b735d3a7b9441840698d27fe4e6b (patch)
tree908c7569373a36970a0c8fe3311798a60b514fe4 /cop.h
parent8b73ab1881b775e12ace39efe757716ab526e9db (diff)
downloadperl-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.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/cop.h b/cop.h
index 91290024cd..fd8e9fa04d 100644
--- a/cop.h
+++ b/cop.h
@@ -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