test lexical $foo = "$foo"
authorDavid Mitchell <[email protected]>
Mon, 2 May 2016 12:59:28 +0000 (13:59 +0100)
committerRicardo Signes <[email protected]>
Tue, 3 May 2016 15:23:03 +0000 (11:23 -0400)
There were some issues with this and SvGROW().
This only occured under valgrind or similar, and only when the first of
two reverts had been done - those revertd being two preceding commits.

See RT #127855.

t/op/lex_assign.t

index 4ea3f24..c4a5062 100644 (file)
@@ -197,6 +197,24 @@ eval {
 };
 is($@, '', 'ex-PVBM assert'.$@);
 
+# RT perl #127855
+# Check that stringification and assignment to itself doesn't break
+# anything. This is unlikely to actually fail the tests; its more something
+# for valgrind to spot. It will also only fail if SvGROW or its caller
+# decides to over-allocate (otherwise copying the string will skip the
+# sv_grow(), as the new size is the same as the current size).
+
+{
+    my $s;
+    for my $len (1..40) {
+        $s = 'x' x $len;
+        my $t = $s;
+        $t = "$t";
+        ok($s eq $t, "RT 127855: len=$len");
+    }
+}
+
+
 done_testing();
 
 __END__