summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index cc01547570..06c899e35e 100644
--- a/mg.c
+++ b/mg.c
@@ -1048,7 +1048,8 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
else
#endif
sv_setpv(sv, errno ? Strerror(errno) : "");
- SvPOK_on(sv); /* may have got removed during taint processing */
+ if (SvPOKp(sv))
+ SvPOK_on(sv); /* may have got removed during taint processing */
RESTORE_ERRNO;
}