diff options
author | Zefram <zefram@fysh.org> | 2010-01-15 17:13:17 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-01-15 17:14:17 +0100 |
commit | b6d1426f94a845fb8fece8b6ad0b7d9f35f2d62e (patch) | |
tree | 54fe1920392ae403777a861a34c9946a65685764 /t | |
parent | 75080c809516a97a6560fd6463b6574c254662f7 (diff) | |
download | perl-b6d1426f94a845fb8fece8b6ad0b7d9f35f2d62e.tar.gz |
[perl #62646] Maximum string length with substr
(This is only a partial fix, since it doesn't handle lvalue substr)
Diffstat (limited to 't')
-rw-r--r-- | t/re/substr.t | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/t/re/substr.t b/t/re/substr.t index c3fa6e10e7..49fd97bea7 100644 --- a/t/re/substr.t +++ b/t/re/substr.t @@ -24,7 +24,7 @@ $SIG{__WARN__} = sub { require './test.pl'; -plan(334); +plan(338); run_tests() unless caller; @@ -682,4 +682,19 @@ is($x, "\x{100}\x{200}\xFFb"); is(substr($a,1,1), 'b'); } +# [perl #62646] offsets exceeding 32 bits on 64-bit system +SKIP: { + skip("32-bit system", 4) unless ~0 > 0xffffffff; + my $a = "abc"; + my $r; + $w = 0; + $r = substr($a, 0xffffffff, 1); + is($r, undef); + is($w, 1); + $w = 0; + $r = substr($a, 0xffffffff+1, 1); + is($r, undef); + is($w, 1); +} + } |