summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-02-06 14:34:49 +0000
committerDavid Mitchell <davem@iabyn.com>2011-02-06 18:57:16 +0000
commitd1bfb649a8c4cc0b39b0fd6371c009b71c0b497f (patch)
treec74e8e6b86235040df01c6223913c1f300dd96ae /pad.c
parent5bcf08c4547e5c6ec79e3cc699bedecb80c1a756 (diff)
downloadperl-d1bfb649a8c4cc0b39b0fd6371c009b71c0b497f.tar.gz
many string evals cause eventual scope issues
[perl #83364]. PL_cop_seqmax is U32 but PAD_MAX was defined as I32_MAX. Once PL_cop_seqmax got above 2 billion it would start to appear spuriosuly as if PL_cop_seqmax > PAD_MAX, so the scope of lexical vars in evals etc went awry. Also replaces a use of ~0 with PAD_MAX, which shouldn't change anything, but is just tidier.
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pad.c b/pad.c
index de462c7254..86884bfaf3 100644
--- a/pad.c
+++ b/pad.c
@@ -128,7 +128,7 @@ For state vars, SVs_PADSTALE is overloaded to mean 'not yet initialised'
#define PARENT_FAKELEX_FLAGS_set(sv,val) \
STMT_START { ((XPVNV*)SvANY(sv))->xnv_u.xpad_cop_seq.xhigh = (val); } STMT_END
-#define PAD_MAX I32_MAX
+#define PAD_MAX U32_MAX
#ifdef PERL_MAD
void pad_peg(const char* s) {
@@ -591,7 +591,7 @@ Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type)
pad_peg("add_anon");
sv_setpvs(name, "&");
/* Are these two actually ever read? */
- COP_SEQ_RANGE_HIGH_set(name, ~0);
+ COP_SEQ_RANGE_HIGH_set(name, PAD_MAX);
COP_SEQ_RANGE_LOW_set(name, 1);
ix = pad_alloc(op_type, SVs_PADMY);
av_store(PL_comppad_name, ix, name);