p4raw-id: //depot/perl@25094
Perl_magic_gettaint(pTHX_ SV *sv, MAGIC *mg)
{
PERL_UNUSED_ARG(sv);
- TAINT_IF(mg->mg_len & 1);
+ TAINT_IF((PL_localizing != 1) && (mg->mg_len & 1));
return 0;
}
Perl_save_scalar(pTHX_ GV *gv)
{
SV **sptr = &GvSV(gv);
+ PL_localizing = 1;
SvGETMAGIC(*sptr);
+ PL_localizing = 0;
SSCHECK(3);
SSPUSHPTR(SvREFCNT_inc(gv));
SSPUSHPTR(SvREFCNT_inc(*sptr));
use File::Spec::Functions;
BEGIN { require './test.pl'; }
-plan tests => 243;
+plan tests => 244;
$| = 1;
test tainted $x99;
}
+# an mg_get of a tainted value during localization shouldn't taint the
+# statement
+
+{
+ eval { local $0, eval '1' };
+ test $@ eq '';
+}