This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #73720] opt_scalarhv(or OP_BOOLKEYS) does not work
authorDavid Leadbeater <dgl@dgl.cx>
Thu, 25 Mar 2010 00:40:35 +0000 (00:40 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 27 Mar 2010 16:27:23 +0000 (16:27 +0000)
commitaaf643cef9412894b3ea120d62ac78b85d183930
tree267e4f3f6675e5b777fc4267d5130c927cdb803a
parent7cf8de9f707ac211c67434c5349598951c28a81c
[perl #73720] opt_scalarhv(or OP_BOOLKEYS) does not work

An optimisation for %hash in boolean context, as introduced with

    867fa1e2da145229b4db2c6e8d5b51700c15f114

could falsely optimise constructs that shoudn't be.

Original bug report and fix suggestion were by Goro Fuji.

Include a test to cover the case which was mis-optimised (although
coverage still seems low to me).

Additionally correct B::Deparse (just swap a line, it was using a
variable before it was defined).
dist/B-Deparse/Deparse.pm
op.c
t/op/each.t