Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix spurious 'Use of reference' warning
My recent OP_MULTIDEREF addition introduced a bug where, when converting a constant array index into a UV, it checked for a ref and issued a "Use of reference "HASH(0x7fd190915ba8)" as array index" warning *before* it had confirmed that the OP_CONST was the only op in the index expression. So things like use constant HASHREF => { a => 1 }; () = $_[HASHREF->{a} ]; would generate two spurious warnings. The fix is easy. Only test for the warning on the second pass; we'll already have abandoned the optimisation attempt on the first pass if the index expression isn't a simple constant.
- Loading branch information