This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
only set CXp_FOR_DEF with CXp_FOR_GV
authorDavid Mitchell <davem@iabyn.com>
Mon, 21 Dec 2015 13:32:13 +0000 (13:32 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 09:18:36 +0000 (09:18 +0000)
commit28e0cf42294edeeb3acfd68afd6695f1f8a09632
treecea982793e857cc8ea6524e65034db43fed66d3b
parent6fb05a88b585ff8c2ecf0a3f089acceca1bae5b7
only set CXp_FOR_DEF with CXp_FOR_GV

C<for (...)> is a special-case of C<for $pkg_var (...)>, so CXp_FOR_DEF
should only be set when CXp_FOR_GV also is. So in pp_enteriter(), only
test for (PL_op->op_private & OPpITER_DEF) in the GV branch and assert
that it's otherwise unset. This is slightly more efficient in the non-GV
branches.

Also add some more commentary to the CXp_FOR_* flag definitions.
cop.h
pp_ctl.c