diff options
author | Karl Williamson <khw@cpan.org> | 2016-11-09 21:55:41 +0100 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-11-12 09:48:59 +0100 |
commit | eee4c92039de41d6a277473b2d60e29584f67431 (patch) | |
tree | 0eb4247c362b86359db2b3bf51f504261e24207d /utf8.c | |
parent | ee3222e312cbf5cc89df7b3cb3bd2ab5bb4e6507 (diff) | |
download | perl-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 { |