|U8 gimme|int filter
#ifndef PERL_NO_INLINE_FUNCTIONS
+Aixp |U8 |gimme_V |
Aixp |PERL_CONTEXT * |cx_pushblock|U8 type|U8 gimme|NN SV** sp|I32 saveix
Aixp |void |cx_popblock|NN PERL_CONTEXT *cx
Aixp |void |cx_topblock|NN PERL_CONTEXT *cx
#define cx_pushsub(a,b,c,d) Perl_cx_pushsub(aTHX_ a,b,c,d)
#define cx_pushwhen(a) Perl_cx_pushwhen(aTHX_ a)
#define cx_topblock(a) Perl_cx_topblock(aTHX_ a)
+#define gimme_V() Perl_gimme_V(aTHX)
#endif
#if defined(DEBUGGING)
#define pad_setsv(a,b) Perl_pad_setsv(aTHX_ a,b)
/* ------------------ cop.h ------------------------------------------- */
+/* implement GIMME_V() macro */
+
+PERL_STATIC_INLINE U8
+Perl_gimme_V(pTHX)
+{
+ I32 cxix;
+ U8 gimme = (PL_op->op_flags & OPf_WANT);
+
+ if (gimme)
+ return gimme;
+ cxix = PL_curstackinfo->si_cxsubix;
+ if (cxix < 0)
+ return G_VOID;
+ gimme = (cxstack[cxix].blk_gimme & G_WANT);
+ if (gimme)
+ return gimme;
+ /* use the full sub to report the error */
+ return block_gimme();
+}
+
/* Enter a block. Push a new base context and return its address. */
=cut
*/
-#define GIMME_V OP_GIMME(PL_op, block_gimme())
+#define GIMME_V Perl_gimme_V(aTHX)
/* Public flags */
return (gimme == G_VOID) ? G_SCALAR : gimme;
}
+/* note that this function has mostly been superseded by Perl_gimme_V */
+
U8
Perl_block_gimme(pTHX)
{
#define PERL_ARGS_ASSERT_CX_TOPBLOCK \
assert(cx)
#endif
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE U8 Perl_gimme_V(pTHX);
+#define PERL_ARGS_ASSERT_GIMME_V
+#endif
#endif
#if !defined(PERL_NO_UTF16_FILTER)
# if defined(PERL_IN_TOKE_C)
code => '$x = f(1)',
},
+ 'call::sub::scalar' => {
+ desc => 'sub called in scalar context',
+ setup => 'my $x; my @a = 1..4; sub f { @a }',
+ code => '$x = f()',
+ },
+
'call::goto::empty' => {
desc => 'goto &funtion with no args or body',
setup => 'sub f { goto &g } sub g {}',