summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-13 21:46:13 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-13 21:46:13 +0000
commit2a509ed3c095f7d712013e653f68821f6bb2d6db (patch)
tree7eacb48b6953b1ce07510234897cabed51e99eb3
parent0be96356bfca2623ae6f5872908239eb3b0f61c9 (diff)
downloadperl-2a509ed3c095f7d712013e653f68821f6bb2d6db.tar.gz
Ensure that public I, N and P flags are off when SvTAINT is called on
something that already has taint magic. p4raw-id: //depot/perl@27176
-rw-r--r--sv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 883ba588af..8c18a83a74 100644
--- a/sv.c
+++ b/sv.c
@@ -4242,8 +4242,13 @@ Perl_sv_magic(pTHX_ register SV *sv, SV *obj, int how, const char *name, I32 nam
/* sv_magic() refuses to add a magic of the same 'how' as an
existing one
*/
- if (how == PERL_MAGIC_taint)
+ if (how == PERL_MAGIC_taint) {
mg->mg_len |= 1;
+ /* Any scalar which already had taint magic on which someone
+ (erroneously?) did SvIOK_on() or similar will now be
+ incorrectly sporting public "OK" flags. */
+ SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK|SVf_POK);
+ }
return;
}
}