summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>2010-07-27 20:45:41 -0700
committerChip Salzenberg <chip@pobox.com>2010-07-27 20:45:41 -0700
commit395b8e2d02eadc9b0639534410c39c530bc8a33d (patch)
tree464dbb27bd52bddbf44dbd709291b3bf505f4fb5 /cop.h
parent1266f6a243b5c49226a55a1f60d6fa0ce69e5b1a (diff)
downloadperl-395b8e2d02eadc9b0639534410c39c530bc8a33d.tar.gz
Fix off-by-one: avoid allocating an extra context
(patch req by Nicholas)
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cop.h b/cop.h
index e5370c4915..7d90891a50 100644
--- a/cop.h
+++ b/cop.h
@@ -732,7 +732,7 @@ struct context {
#define CxFOREACHDEF(c) ((CxTYPE_is_LOOP(c) && CxTYPE(c) != CXt_LOOP_PLAIN) \
&& ((c)->cx_type & CXp_FOR_DEF))
-#define CXINC (cxstack_ix < cxstack_max ? ++cxstack_ix : (cxstack_ix = cxinc()))
+#define CXINC ((cxstack_ix + 1) < cxstack_max ? ++cxstack_ix : (cxstack_ix = cxinc()))
/*
=head1 "Gimme" Values