summaryrefslogtreecommitdiff
path: root/t/op/vec.t
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2003-02-15 06:27:07 +0000
committerhv <hv@crypt.org>2003-02-15 06:27:07 +0000
commit24aef97f7fec4668a5731fc6d5179ebebd43f183 (patch)
treea6c024a90f162d75254414cd7cacbf565c158012 /t/op/vec.t
parent163e3a99f83605ff107fb86a86c7dd9dc9dece8f (diff)
downloadperl-24aef97f7fec4668a5731fc6d5179ebebd43f183.tar.gz
Re: [perl #20933] \substr reuses lvalues (sometimes)
From: Dave Mitchell <davem@fdgroup.com> Date: Fri, 14 Feb 2003 22:48:27 +0000 Message-ID: <20030214224827.B6783@fdgroup.com> with tests: From: Slaven Rezic <slaven@rezic.de> Date: 14 Feb 2003 20:23:20 +0100 Message-ID: <87bs1e4qfr.fsf@vran.herceg.de> p4raw-id: //depot/perl@18705
Diffstat (limited to 't/op/vec.t')
-rwxr-xr-xt/op/vec.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/op/vec.t b/t/op/vec.t
index 67d7527412..158711f6ea 100755
--- a/t/op/vec.t
+++ b/t/op/vec.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..30\n";
+print "1..31\n";
my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0;
@@ -86,3 +86,14 @@ print "ok 29\n";
vec(substr($foo, 1,3), 5, 4) = 3;
print "not " if $foo ne "\x61\x62\x63\x34\x65\x66";
print "ok 30\n";
+
+# A variation of [perl #20933]
+{
+ my $s = "";
+ vec($s, 0, 1) = 0;
+ vec($s, 1, 1) = 1;
+ my @r;
+ $r[$_] = \ vec $s, $_, 1 for (0, 1);
+ print "not " if (${ $r[0] } != 0 || ${ $r[1] } != 1);
+ print "ok 31\n";
+}