diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-10 16:28:40 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-11 07:41:25 -0700 |
commit | 56e04a766185949119c93e963353f9a8712b8ec1 (patch) | |
tree | be9f3be0c5e777ed58ddbbd3633e8730d812a201 /lib/utf8.t | |
parent | 53f2736e93810ee2954fb2a08b4d43366caae935 (diff) | |
download | perl-56e04a766185949119c93e963353f9a8712b8ec1.tar.gz |
op.c:ck_svconst: Don’t allow ro COWs under old COW
Under PERL_OLD_COPY_ON_WRITE, allowing COWs to become read-only will
complicate things elsewhere. It uses the IV slot of an SV to point
to a loop of SVs sharing the same buffer. sv_2iv cannot cache the IV
without running the SV through sv_force_normal, but that will croak on
read-only values. I could change it to S_sv_uncow, but there are more
cases elsewhere that would have to be audited, I don’t think it’s
worth spending time on improving PERL_OLD_COPY_ON_WRITE as it’s ‘dead
code, never intended to go live’ according to its author. I am
bothering with at least this much because I don’t want to break it
knowingly.
Diffstat (limited to 'lib/utf8.t')
-rw-r--r-- | lib/utf8.t | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/lib/utf8.t b/lib/utf8.t index e6c94e6dc4..3978187264 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -565,17 +565,8 @@ for my $pos (0..5) { # [perl #119043] utf8::upgrade should not croak on read-only COWs for(__PACKAGE__) { - # First make sure we have a COW, otherwise this test is useless. - my $copy = $_; - my @addrs = unpack "L!L!", pack "pp", $copy, $_; - if ($addrs[0] != $addrs[1]) { - fail("__PACKAGE__ did not produce a COW - if this change was " - ."intentional, please provide me with another ro COW scalar") - } - else { eval { utf8::upgrade($_) }; is $@, "", 'no error with utf8::upgrade on read-only COW'; - } } # This one croaks, but not because the scalar is read-only eval "package \x{100};\n" . <<'END' |