summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-11-09 21:55:41 +0100
committerKarl Williamson <khw@cpan.org>2016-11-12 09:48:59 +0100
commiteee4c92039de41d6a277473b2d60e29584f67431 (patch)
tree0eb4247c362b86359db2b3bf51f504261e24207d /utf8.c
parentee3222e312cbf5cc89df7b3cb3bd2ab5bb4e6507 (diff)
downloadperl-eee4c92039de41d6a277473b2d60e29584f67431.tar.gz
PATCH: [perl #130010] a5540cf breaks texinfo
When a regular expression is compiled that contains user-defined properties, the subroutine the user must furnish to implement those properties may not yet be defined. To cope with this possibility, the regex pattern compiler stores the name and package of the subroutine, and this is to be expanded the first time the property is actually used during execution. Once expanded, the property should be immutable, and so the scalar containing the expansion is marked read-only. It turns out that prior to the blamed commit, that read-only-ness was being bypassed in some instances simply by freeing the scalar, replaced by a new one. The commit changed that. The pattern may contain components both known at compile time, and deferred until runtime. The two are combined at the time of expansion, but that was now running afoul of the read-only setting. This commit simply turns off the read-only flag at the time of expansion, and it's turned on again afterwards. The next commit will add a test.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index 0a4466f254..4dbefe59c1 100644
--- a/utf8.c
+++ b/utf8.c
@@ -3398,6 +3398,7 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m
/* Add the passed-in inversion list, which invalidates the one
* already stored in the swash */
invlist_in_swash_is_valid = FALSE;
+ SvREADONLY_off(swash_invlist); /* Turned on again below */
_invlist_union(invlist, swash_invlist, &swash_invlist);
}
else {