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.
case OP_GV:
/* it may be a package var index */
- ASSUME(!(o->op_flags & ~(OPf_WANT|OPf_SPECIAL)));
+ ASSUME(!(o->op_flags & ~(OPf_WANT|OPf_PARENS|OPf_SPECIAL)));
ASSUME(!(o->op_private & ~(OPpEARLY_CV)));
- if ( (o->op_flags &~ OPf_SPECIAL) != OPf_WANT_SCALAR
+ if ( (o->op_flags & ~(OPf_PARENS|OPf_SPECIAL)) != OPf_WANT_SCALAR
|| o->op_private != 0
)
break;
use warnings;
use strict;
-plan 62;
+plan 63;
# check that strict refs hint is handled
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)->$*]';
+}
+