summaryrefslogtreecommitdiff
path: root/t/op/tr.t
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2009-07-11 17:56:06 +0100
committerDavid Mitchell <davem@iabyn.com>2009-07-11 17:58:16 +0100
commita5446a64ab75205e7ec7185a30ff6e9f7c532dd0 (patch)
treeabdd58ad43fe8e4a4ac10f9acd36724c3afa63f8 /t/op/tr.t
parentd55aad059d63cf3faa3b5bcd033bc19193d5f1b9 (diff)
downloadperl-a5446a64ab75205e7ec7185a30ff6e9f7c532dd0.tar.gz
[perl #61520] Segfault in debugger with tr// and UTF8
commit 043e41b8 (29765), which made tr// threadsafe by moving the swash into the pad, didn't mark the pad SV as read-only, so it was getting removed from anon sub prototypes
Diffstat (limited to 't/op/tr.t')
-rw-r--r--t/op/tr.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/op/tr.t b/t/op/tr.t
index 9273e09d19..3f85e43758 100644
--- a/t/op/tr.t
+++ b/t/op/tr.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 118;
+plan tests => 119;
my $Is_EBCDIC = (ord('i') == 0x89 & ord('J') == 0xd1);
@@ -468,3 +468,19 @@ my $wasro = Internals::SvREADONLY($s);
$s =~ tr/i//;
ok( Internals::SvREADONLY($s), "count-only tr doesn't deCOW COWs" );
}
+
+# [ RT #61520 ]
+#
+# under threads, unicode tr within a cloned closure would SEGV or assert
+# fail, since the pointer in the pad to the swash was getting zeroed out
+# in the proto-CV
+
+{
+ my $x = "\x{142}";
+ sub {
+ $x =~ tr[\x{142}][\x{143}];
+ }->();
+ is($x,"\x{143}", "utf8 + closure");
+}
+
+