summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-11-03 22:18:11 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-11-13 04:49:43 -0800
commit03414f05f41ecc10f644b53e455358ae8125d158 (patch)
tree4e43886a0a737a67e023c64195858cd14a62a83e /pad.c
parent7a2b740ab541f1d6fadd7282391ae3fda8c1c3af (diff)
downloadperl-03414f05f41ecc10f644b53e455358ae8125d158.tar.gz
Account for string eval when const-izing sub(){$x}
If we have a string eval in the same scope as the variable, it is potentially in value context.
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/pad.c b/pad.c
index e45b5441f9..9625de90db 100644
--- a/pad.c
+++ b/pad.c
@@ -1233,31 +1233,8 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv,
fake_offset = offset; /* in case we don't find a real one */
continue;
}
- /* is seq within the range _LOW to _HIGH ?
- * This is complicated by the fact that PL_cop_seqmax
- * may have wrapped around at some point */
- if (COP_SEQ_RANGE_LOW(namesv) == PERL_PADSEQ_INTRO)
- continue; /* not yet introduced */
-
- if (COP_SEQ_RANGE_HIGH(namesv) == PERL_PADSEQ_INTRO) {
- /* in compiling scope */
- if (
- (seq > COP_SEQ_RANGE_LOW(namesv))
- ? (seq - COP_SEQ_RANGE_LOW(namesv) < (U32_MAX >> 1))
- : (COP_SEQ_RANGE_LOW(namesv) - seq > (U32_MAX >> 1))
- )
- break;
- }
- else if (
- (COP_SEQ_RANGE_LOW(namesv) > COP_SEQ_RANGE_HIGH(namesv))
- ?
- ( seq > COP_SEQ_RANGE_LOW(namesv)
- || seq <= COP_SEQ_RANGE_HIGH(namesv))
-
- : ( seq > COP_SEQ_RANGE_LOW(namesv)
- && seq <= COP_SEQ_RANGE_HIGH(namesv))
- )
- break;
+ if (PadnameIN_SCOPE(namesv, seq))
+ break;
}
}