In perl.git, the branch smoke-me/arc/inline-coresub-less-special has been created
<http://perl5.git.perl.org/perl.git/commitdiff/7eff711c289404ceb57bc00692b5c883773fc51c?hp=0000000000000000000000000000000000000000> at 7eff711c289404ceb57bc00692b5c883773fc51c (commit) - Log ----------------------------------------------------------------- commit 7eff711c289404ceb57bc00692b5c883773fc51c Author: Aaron Crane <a...@cpan.org> Date: Tue Jul 15 18:28:42 2014 +0100 Fix bug in inlining some CORE::* subs As of 4aaa475724fbbc4ab2427743fa4d07a12e6ce0d9, when Perl compiles code like BEGIN { *inlined = \&CORE::tie } entangle $foo, $package the apparent call to "entangle" is replaced with an inlined invocation of the "tie" builtin. For unary ops, the OPf_SPECIAL flag was set on the generated inlined op iff the op's argument was surrounded by parens. But that's incorrect for ops which have their own interpretation of OPf_SPECIAL. In particular: keys, values, each OPf_SPECIAL is set for lvalue usage; this shows up when the compile-time argument is a reference to be subjected to the autoderef feature, and the run-time argument is an array ref. The existing tests didn't execute the code (and didn't combine inlining with array autoderefs), so didn't catch this case. delete, exists OPf_SPECIAL is set when the argument is an array element rather than a hash element; this doesn't directly cause any obvious problems, because pp_delete and pp_exists consider OPf_SPECIAL only when they've already determined that their argument is an array, but it did break deparsing (because B::Deparse considers OPf_SPECIAL in all cases). Further, the inlining tests themselves rely on deparsing to ensure that the op was inlined. The existing inlining tests happened to use array elements, so didn't catch this problem. This commit fixes those cases, by avoiding setting OPf_SPECIAL when inlining an invocation of one of those ops. This seems a little icky, but I don't see a better alternative. I believe that no other ops are affected by this issue, but my confidence in that statement isn't as high as it might be. M op.c M t/op/coresubs.t commit d1a953ad5cde26a5d4454d8b510e37e515670889 Author: Aaron Crane <a...@cpan.org> Date: Tue Jul 15 18:25:22 2014 +0100 t/op/coresubs.t: factor out an internal routine M t/op/coresubs.t ----------------------------------------------------------------------- -- Perl5 Master Repository