summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGerard Goossen <gerard@ggoossen.net>2010-12-21 13:57:34 +0100
committerZefram <zefram@fysh.org>2011-01-08 13:38:39 +0000
commit5a909b52c3c34749a76f76e5a103db6b13304f29 (patch)
treefb99d96f948c068d52dc0487976d7b873fb0d0e3 /t
parenta720890cfcdb8354a4cdb3aa4c7c71da950da59f (diff)
downloadperl-5a909b52c3c34749a76f76e5a103db6b13304f29.tar.gz
add a taint test to catch codegen bug
New test covers something previously done wrong in the experimental code-generation patch.
Diffstat (limited to 't')
-rw-r--r--t/op/taint.t11
1 files changed, 9 insertions, 2 deletions
diff --git a/t/op/taint.t b/t/op/taint.t
index 99a6a59a98..e873ba25b9 100644
--- 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 => 339;
+plan tests => 340;
$| = 1;
@@ -1470,7 +1470,14 @@ end
::is($w, "", "RT 81230");
}
-
+{
+ # Compiling a subroutine inside a tainted expression does not make the
+ # constant folded values tainted.
+ my $x = sub { "x" . "y" };
+ my $y = $ENV{PATH} . $x->(); # Compile $x inside a tainted expression
+ my $z = $x->();
+ ok( ! tainted($z), "Constants folded value not tainted");
+}
# This may bomb out with the alarm signal so keep it last
SKIP: {