diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-23 14:18:16 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-23 14:45:55 -0800 |
commit | 1e6bda93199bc72086fd20f4dab89d46590b379a (patch) | |
tree | d3c9063779f46754f059847ce4708cd2dc3dad15 /t | |
parent | f0cd42383d11de42b3b8137c27c960b257975418 (diff) | |
download | perl-1e6bda93199bc72086fd20f4dab89d46590b379a.tar.gz |
[perl #29070] Add vstring set-magic
Some operators, like pp_complement, assign their argument to TARG
(which copies vstring magic), modify it in place, and then call set-
magic. That’s supposed to work, but vstring magic was remaining as it
was, such that ~v7 would still be treated as "v7" by vstring-aware
code, even though the resulting string is not "\7".
This commit adds vstring set-magic that checks to see whether the pv
still matches the vstring. It cannot simply free the vstring magic,
as that would prevent $x=v0 from working.
Diffstat (limited to 't')
-rw-r--r-- | t/op/bop.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/bop.t b/t/op/bop.t index 238d2727fa..0f28f79244 100644 --- a/t/op/bop.t +++ b/t/op/bop.t @@ -15,7 +15,7 @@ BEGIN { # If you find tests are failing, please try adding names to tests to track # down where the failure is, and supply your new names as a patch. # (Just-in-time test naming) -plan tests => 171 + (10*13*2) + 4; +plan tests => 171 + (10*13*2) + 5; # numerics ok ((0xdead & 0xbeef) == 0x9ead); @@ -554,3 +554,7 @@ $strval = "x"; eval { $obj |= "Q" }; $strval = "z"; is("$obj", "z", "|= doesn't break string overload"); + +# [perl #29070] +$^A .= new version ~$_ for "\xce", v205, "\xcc"; +is $^A, "123", '~v0 clears vstring magic on retval'; |