summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-07-12 12:24:29 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-07-12 13:00:02 -0700
commitfa819c1ce3252e7ae97e9cdd4d3d0dd1edb06fa1 (patch)
tree9de6862f1c09e08526ecb4c315aec824c6f82b8e /sv.h
parent21690b721fd5cd765bcc0330aa94f9172c24582d (diff)
downloadperl-fa819c1ce3252e7ae97e9cdd4d3d0dd1edb06fa1.tar.gz
Make SvIsCOW honest about globs
SvIsCOW was ignoring the fact that it might be passed a typeglob, which made its behaviour contradict its docs. This fixes that and, in doing so, simplifies the upcoming Internals::SvREADONLY fix.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sv.h b/sv.h
index 5f58935ddc..7686d4e7f0 100644
--- a/sv.h
+++ b/sv.h
@@ -1738,8 +1738,8 @@ Like sv_utf8_upgrade, but doesn't do magic on C<sv>
# define SvTRUEx(sv) ((PL_Sv = (sv)), SvTRUE(PL_Sv))
#endif /* __GNU__ */
-#define SvIsCOW(sv) ((SvFLAGS(sv) & (SVf_FAKE | SVf_READONLY)) == \
- (SVf_FAKE | SVf_READONLY))
+#define SvIsCOW(sv) ((SvFLAGS(sv) & (SVf_FAKE | SVf_READONLY)) == \
+ (SVf_FAKE | SVf_READONLY) && !isGV_with_GP(sv))
#define SvIsCOW_shared_hash(sv) (SvIsCOW(sv) && SvLEN(sv) == 0)
#define SvSHARED_HEK_FROM_PV(pvx) \