summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-02-06 17:31:39 +0000
committerDavid Mitchell <davem@iabyn.com>2011-02-06 18:57:16 +0000
commit6012dc8015d0c5599f09bcca302ae714d023aced (patch)
tree877cd51015817479ffc1f21de2a3ec825385a3a4 /op.c
parent0d311cdbe540a08e243ac533c7bcdb73529352db (diff)
downloadperl-6012dc8015d0c5599f09bcca302ae714d023aced.tar.gz
allow wrap-around of PL_cop_seqmax
After a large number of evals, PL_cop_seqmax (a U32) will wrap around again to zero. Make the code handle this case by: 1) When incrementing PL_cop_seqmax, never allow its value to become equal to PERL_PADSEQ_INTRO; 2) When testing for COP_SEQ_RANGE_LOW < seq <= COP_SEQ_RANGE_HIGH, allow for the fact that _HIGH may be lower than _LOW. This is a final fix for [perl #83364].
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/op.c b/op.c
index ad94f6ef8d..2e15a8dc68 100644
--- a/op.c
+++ b/op.c
@@ -4356,6 +4356,8 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *idop, OP *arg)
PL_parser->copline = NOLINE;
PL_parser->expect = XSTATE;
PL_cop_seqmax++; /* Purely for B::*'s benefit */
+ if (PL_cop_seqmax == PERL_PADSEQ_INTRO) /* not a legal value */
+ PL_cop_seqmax++;
#ifdef PERL_MAD
if (!PL_madskills) {