summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-22 22:39:47 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-22 22:39:47 -0800
commit3a482d8d6250628185cb4de79a85f353ba799a58 (patch)
tree73f23180f51545b880bec52716c162ea7cd9f7c1 /sv.h
parent1ef8987b48398aed58d54d2cf83033cbbb7f3d7f (diff)
downloadperl-3a482d8d6250628185cb4de79a85f353ba799a58.tar.gz
sv_force_normal: Don’t confuse regexps with cows
Otherwise we get assertion failures and possibly corrupt string tables.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.h b/sv.h
index 48b05ec2a4..935f4fff15 100644
--- a/sv.h
+++ b/sv.h
@@ -1745,7 +1745,8 @@ Like sv_utf8_upgrade, but doesn't do magic on C<sv>.
#endif /* __GNU__ */
#define SvIsCOW(sv) ((SvFLAGS(sv) & (SVf_FAKE | SVf_READONLY)) == \
- (SVf_FAKE | SVf_READONLY) && !isGV_with_GP(sv))
+ (SVf_FAKE | SVf_READONLY) && !isGV_with_GP(sv) \
+ && SvTYPE(sv) != SVt_REGEXP)
#define SvIsCOW_shared_hash(sv) (SvIsCOW(sv) && SvLEN(sv) == 0)
#define SvSHARED_HEK_FROM_PV(pvx) \