summaryrefslogtreecommitdiff
path: root/pp_hot.c
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 /pp_hot.c
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 'pp_hot.c')
-rw-r--r--pp_hot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index a7657f8648..ca0b4abc43 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1914,7 +1914,7 @@ PP(pp_iter)
av = CxTYPE(cx) == CXt_LOOP_STACK ? PL_curstack : cx->blk_loop.iterary;
if (SvTYPE(av) != SVt_PVAV) {
/* iterate ($min .. $max) */
- if (cx->blk_loop.iterlval) {
+ if (CxTYPE(cx) != CXt_LOOP_LAZYIV) {
/* string increment */
register SV* cur = cx->blk_loop.iterlval;
STRLEN maxlen = 0;
@@ -1944,6 +1944,7 @@ PP(pp_iter)
RETPUSHNO;
}
/* integer increment */
+ assert(!cx->blk_loop.iterlval);
if (cx->blk_loop.iterix > cx->blk_loop.itermax)
RETPUSHNO;