From eebd3bc0dfa10c5d80023c98a5e80dc4fb6689ca Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 14 Jul 2011 21:49:08 -0700 Subject: [PATCH] Change was_lvalue_sub back to X; spell out the only use of it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit OK, now I understand what’s happening. If there is a public macro (PUSHSUB) that contains a call to a pri- vate function (was_lvalue_sub), that function has to be exported, so that non-core code can call it. But if it is marked X, there is no was_lvalue_sub shorthand macro visible to non-core code, so when the PUSHSUB macro is expanded in such code, the was_lvalue_sub(...) bit becomes a call to the function literally named was_lvalue_sub, as opposed to Perl_lvalue_sub (and is compiled that way on forgiving platforms). Making it A makes that macro available to non-core code, but also implies that it is available for direct use by extensions, which is not the case with was_lvalue_sub. So, this commit makes it X again, but spells it out in PUSHSUB, so there is no need for the function’s macro to be available when PUSHSUB is expanded. Hence, there is no need for the was_lvalue_sub macro to exist, so this commit also removes it. See also these three commits: c73b0699db 7b70e81778 777d901444 --- cop.h | 2 +- embed.fnc | 2 +- embed.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cop.h b/cop.h index d261edf..e6650a2 100644 --- a/cop.h +++ b/cop.h @@ -640,7 +640,7 @@ struct block_format { (PL_op->op_flags & OPf_WANT) \ ? OPpENTERSUB_LVAL_MASK \ : !(PL_op->op_private & OPpENTERSUB_LVAL_MASK) \ - ? 0 : was_lvalue_sub(); \ + ? 0 : Perl_was_lvalue_sub(aTHX); \ PUSHSUB_BASE(cx) \ cx->blk_u16 = PL_op->op_private & \ (phlags|OPpENTERSUB_DEREF); \ diff --git a/embed.fnc b/embed.fnc index e787f10..0f4424a 100644 --- a/embed.fnc +++ b/embed.fnc @@ -544,7 +544,7 @@ p |bool |io_close |NN IO* io|bool not_implicit pR |OP* |invert |NULLOK OP* cmd ApR |I32 |is_lvalue_sub : Used in cop.h -ApR |I32 |was_lvalue_sub +XopR |I32 |was_lvalue_sub ApPR |U32 |to_uni_upper_lc|U32 c ApPR |U32 |to_uni_title_lc|U32 c ApPR |U32 |to_uni_lower_lc|U32 c diff --git a/embed.h b/embed.h index 750c0da..fa1a2a9 100644 --- a/embed.h +++ b/embed.h @@ -680,7 +680,6 @@ #ifndef PERL_IMPLICIT_CONTEXT #define warner Perl_warner #endif -#define was_lvalue_sub() Perl_was_lvalue_sub(aTHX) #define whichsig(a) Perl_whichsig(aTHX_ a) #if !(defined(HAS_SIGACTION) && defined(SA_SIGINFO)) #define csighandler Perl_csighandler -- 2.7.4