diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2017-06-22 20:41:58 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2017-08-23 21:22:40 +0100 |
commit | e3875c509ec2899a5cb68c3eba97b49c381281ad (patch) | |
tree | a593fa331ff08c08652191c2052efd138cc79c64 /t | |
parent | ddb60739b677c3b9a31b35412ff7daaa23b28915 (diff) | |
download | perl-e3875c509ec2899a5cb68c3eba97b49c381281ad.tar.gz |
[perl #131627] Fix multideref for $x{qw/a/->$*}
qw// sets OPf_PARENS on the OP_CONST it generates, which persists when
->$* turns it into an OP_GV.
This used to cause an assertion failure on debugging builds, and didn't
get the multideref optimisation on non-debugging.
(cherry picked from commit e13dc8886fcabf88a521e8e73c358157b1fa4c8a)
Diffstat (limited to 't')
-rw-r--r-- | t/op/multideref.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/multideref.t b/t/op/multideref.t index 199e523451..20ba1ca614 100644 --- a/t/op/multideref.t +++ b/t/op/multideref.t @@ -18,7 +18,7 @@ BEGIN { use warnings; use strict; -plan 62; +plan 63; # check that strict refs hint is handled @@ -223,3 +223,13 @@ sub defer {} ok !defined $x[0][0],"RT #130727 part 2: array not autovivified"; } + +# RT #131627: assertion failure on OPf_PAREN on OP_GV +{ + my @x = (10..12); + our $rt131627 = 1; + + no strict qw(refs vars); + is $x[qw(rt131627)->$*], 11, 'RT #131627: $a[qw(var)->$*]'; +} + |