diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-11-01 07:07:36 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-11-13 04:49:38 -0800 |
commit | 0ac016fc68a8b6f210ddacb62494e53da203c571 (patch) | |
tree | 25a223ed56d7a4b515fc209a97e6ca9d3c88cc36 /proto.h | |
parent | 0b2df18fd3736ebdac552d596b8976109f9f4643 (diff) | |
download | perl-0ac016fc68a8b6f210ddacb62494e53da203c571.tar.gz |
Deprecate inlining sub(){$x} if $x is changed elsewhere
With the new PadnameLVALUE flag, we can detect cases where an outer
lexical is used multiple times in lvalue context. If the subroutine
contains just a lexical variable and nothing else, deprecate this
behaviour, so we can change it not to break the closure pattern at
some future date.
Future commits will fix those cases where the subroutine contains more
than just a lexical variable, without a deprecation cycle.
Adding this code to op_const_sv doesn’t really make sense. More to
the point, having S_cv_clone_pad call op_const_sv doesn’t make sense,
but changing that (moving this code directly to S_cv_clone_pad) will
require other refactorings to avoid breaking some cases of constant
(real constant) inlining, such as sub(){$x++ if 0; 3}, which cur-
rently gets inlined.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3196,7 +3196,7 @@ PERL_CALLCONV void Perl_op_clear(pTHX_ OP* o) #define PERL_ARGS_ASSERT_OP_CLEAR \ assert(o) -PERL_CALLCONV SV* Perl_op_const_sv(pTHX_ const OP* o, CV* cv) +PERL_CALLCONV SV* Perl_op_const_sv(pTHX_ const OP* o, CV* cv, CV *outside) __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_op_contextualize(pTHX_ OP* o, I32 context) |