diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-01-02 21:10:13 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-01-02 21:10:13 +0000 |
commit | 085bde857c12ca3212eb9b96db84091274a8025c (patch) | |
tree | 9bfcb8f931a10077e04126004d4dc76ad9a51a4c /t | |
parent | 2e94196c9b65166bc30c1956b01df877a36f8934 (diff) | |
download | perl-085bde857c12ca3212eb9b96db84091274a8025c.tar.gz |
Assignment to a tainted variable was causing confusion if the source
value was an NV too large for an IV (bug #40708). Fix the confusion
by not promoting private flags to public flags in S_save_magic if
there are already public flags.
p4raw-id: //depot/perl@29669
Diffstat (limited to 't')
-rwxr-xr-x | t/op/taint.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index 9e4bba2d70..533733276a 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -17,7 +17,7 @@ use Config; use File::Spec::Functions; BEGIN { require './test.pl'; } -plan tests => 255; +plan tests => 257; $| = 1; @@ -1218,3 +1218,15 @@ SKIP: eval { sprintf("# %s\n", $TAINT . "foo") }; ok(!$@, q/sprintf accepts other tainted args/); } + +{ + # 40708 + my $n = 7e9; + 8e9 - $n; + + my $val = $n; + is ($val, '7000000000', 'Assignment to untainted variable'); + $val = $TAINT; + $val = $n; + is ($val, '7000000000', 'Assignment to tainted variable'); +} |