summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-06-28 17:14:45 +0100
committerNicholas Clark <nick@ccl4.org>2010-06-30 09:11:17 +0100
commit5bb89d25eef36595e8b2275f7b0739655e3535d5 (patch)
treefda83110d4652e0502eebfe7fc2d73eceac777b1 /sv.c
parent8a0cff6917bc9219abe47c208f7b997d8eb6d7a5 (diff)
downloadperl-5bb89d25eef36595e8b2275f7b0739655e3535d5.tar.gz
Only allow SvPVX() on SVt_PVIO when IOf_FAKE_DIRP is set.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 9a4a082309..3111c75585 100644
--- a/sv.c
+++ b/sv.c
@@ -11132,7 +11132,8 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
#endif
if (sv_type != SVt_PVAV && sv_type != SVt_PVHV
- && !isGV_with_GP(dstr))
+ && !isGV_with_GP(dstr)
+ && !(sv_type == SVt_PVIO && !(IoFLAGS(dstr) & IOf_FAKE_DIRP)))
Perl_rvpv_dup(aTHX_ dstr, sstr, param);
/* The Copy above means that all the source (unduplicated) pointers