summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index 408c7debf2..bdf204bd8f 100644
--- a/mg.c
+++ b/mg.c
@@ -658,7 +658,9 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
#endif
}
else if (strEQ(mg->mg_ptr, "\024AINT"))
- sv_setiv(sv, PL_tainting);
+ sv_setiv(sv, PL_tainting
+ ? (PL_taint_warn || PL_unsafe ? -1 : 1)
+ : 0);
break;
case '\027': /* ^W & $^WARNING_BITS & ^WIDE_SYSTEM_CALLS */
if (*(mg->mg_ptr+1) == '\0')