Skip to content

Commit 32768ce

Browse files
committed
Add a regression test for GH #24006
1 parent 82609a1 commit 32768ce

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

t/op/array.t

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ BEGIN {
66
set_up_inc('.', '../lib');
77
}
88

9-
plan (198);
9+
plan (199);
1010

1111
#
1212
# @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -734,3 +734,15 @@ fresh_perl_is('my @x;$x[0] = 1;shift @x;$x[22] = 1;$x[25] = 1;','',
734734
is($arr[1], 3,
735735
'Array element within array range created at correct index from subroutine @_ alias; GH 16364');
736736
}
737+
738+
# regression test for GH #24006
739+
{
740+
use feature qw(refaliasing);
741+
no warnings 'experimental::refaliasing';
742+
my @arr = (1, 2);
743+
Internals::SvREADONLY(@arr, 1);
744+
745+
eval { \$arr[1] = \42 };
746+
ok !$@, "Last element's contents of a readonly array can be modified";
747+
}
748+

0 commit comments

Comments
 (0)