/* subroutine context */
struct block_sub {
OP * retop; /* op to execute on exit from sub */
+ I32 old_cxsubix; /* previous value of si_cxsubix */
/* Above here is the same for sub, format and eval. */
PAD *prevcomppad; /* the caller's PL_comppad */
CV * cv;
/* format context */
struct block_format {
OP * retop; /* op to execute on exit from sub */
+ I32 old_cxsubix; /* previous value of si_cxsubix */
/* Above here is the same for sub, format and eval. */
PAD *prevcomppad; /* the caller's PL_comppad */
CV * cv;
/* eval context */
struct block_eval {
OP * retop; /* op to execute on exit from eval */
+ I32 old_cxsubix; /* previous value of si_cxsubix */
/* Above here is the same for sub, format and eval. */
SV * old_namesv;
OP * old_eval_root;
struct stackinfo * si_next;
I32 si_cxix; /* current context index */
I32 si_cxmax; /* maximum allocated index */
+ I32 si_cxsubix; /* topmost sub/eval/format */
I32 si_type; /* type of runlevel */
I32 si_markoff; /* offset where markstack begins for us.
* currently used only with DEBUGGING,
} \
next->si_type = type; \
next->si_cxix = -1; \
+ next->si_cxsubix = -1; \
PUSHSTACK_INIT_HWM(next); \
AvFILLp(next->si_stack) = 0; \
SWITCHSTACK(PL_curstack,next->si_stack); \
|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)
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 7 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 6 <@> sort vK ->7
# 3 <0> pushmark s ->4
# 4 <#> gv[*a] s ->5
EOT_EOT
# 7 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 6 <@> sort vK ->7
# 3 <0> pushmark s ->4
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> pushmark s
4 <#> gv[*a] s
6 <@> sort vK
7 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <$> gv(*a) s
errs => ['Useless use of sort in void context at -e line 1.'],
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <#> gv[*a] s
# 6 <@> sort vK
# 7 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <$> gv(*a) s
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 6 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3
# 5 <@> print vK ->6
# 3 <0> pushmark s ->4
# 4 <$> const[SPECIAL sv_yes] s*/FOLD ->5
EOT_EOT
# 6 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3
# 5 <@> print vK ->6
# 3 <0> pushmark s ->4
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 6 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3
# 5 <@> print vK ->6
# 3 <0> pushmark s ->4
# 4 <$> const[SPECIAL sv_no] s*/FOLD ->5
EOT_EOT
# 6 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3
# 5 <@> print vK ->6
# 3 <0> pushmark s ->4
my $t = <<'EOT_EOT';
# 8 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 7 <2> sassign vKS/2 ->8
# 5 <@> index[t2] sK/2 ->6
EOT_EOT
my $nt = <<'EONT_EONT';
# 8 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 7 <2> sassign vKS/2 ->8
# 5 <@> index[t1] sK/2 ->6
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <$> const[IV 1] s
# g <2> leaveloop vK/2
# h <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 2 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <$> const(IV 1) s
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 71 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <$> const[PV "junk"] s*/FOLD
# 5 <@> print vK
# 6 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 71 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <$> const(PV "junk") s*/FOLD
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> pushmark s
4 <#> gv[*a] s
6 <@> sort vK
7 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <$> gv(*a) s
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> pushmark s
4 <0> pushmark s
7 <@> sort lK/INPLACE
8 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <0> pushmark s
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> pushmark s
4 <0> pushmark s
c <@> reverse[t8] vK/1
d <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <0> pushmark s
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> padav[@a:1,2] vM/LVINTRO
4 <;> nextstate(main 2 -e:1) v:>,<,%,{
8 <@> sort lK/INPLACE
9 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> padav[@a:1,2] vM/LVINTRO
# 4 <;> nextstate(main 2 -e:1) v:>,<,%,{
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 4 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 3 <0> padsv[$a:1,2] vM/LVINTRO ->4
EOT_EOT
# 4 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 3 <0> padsv[$a:1,2] vM/LVINTRO ->4
EONT_EONT
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
3 <@> leave[1 ref] vKP/REFC ->(end)
-1 <0> enter ->2
+1 <0> enter v ->2
2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
- <1> rv2sv vK/OURINTR,1 ->3
- <#> gv[*a] s ->-
EOT_EOT
# 3 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# - <1> rv2sv vK/OURINTR,1 ->3
# - <$> gv(*a) s ->-
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
4 <@> leave[1 ref] vKP/REFC ->(end)
-1 <0> enter ->2
+1 <0> enter v ->2
2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
- <1> ex-rv2sv vKM/LVINTRO,1 ->4
3 <#> gvsv[*c] s/LVINTRO ->4
EOT_EOT
# 4 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# - <1> ex-rv2sv vKM/LVINTRO,1 ->4
# 3 <$> gvsv(*c) s/LVINTRO ->4
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
6 <@> leave[1 ref] vKP/REFC ->(end)
-1 <0> enter ->2
+1 <0> enter v ->2
2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
5 <2> sassign vKS/2 ->6
3 <0> undef s ->4
4 <0> padsv[$a:1,2] sRM*/LVINTRO ->5
EOT_EOT
# 6 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 5 <2> sassign vKS/2 ->6
# 3 <0> undef s ->4
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
6 <@> leave[1 ref] vKP/REFC ->(end)
-1 <0> enter ->2
+1 <0> enter v ->2
2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
5 <2> sassign vKS/2 ->6
3 <0> undef s ->4
4 <#> gvsv[*a] s/OURINTR ->5
EOT_EOT
# 6 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 5 <2> sassign vKS/2 ->6
# 3 <0> undef s ->4
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
6 <@> leave[1 ref] vKP/REFC ->(end)
-1 <0> enter ->2
+1 <0> enter v ->2
2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
5 <2> sassign vKS/2 ->6
3 <0> undef s ->4
4 <#> gvsv[*c] s/LVINTRO ->5
EOT_EOT
# 6 <@> leave[1 ref] vKP/REFC ->(end)
-# 1 <0> enter ->2
+# 1 <0> enter v ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# 5 <2> sassign vKS/2 ->6
# 3 <0> undef s ->4
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> stub sP
4 <0> padsv[$a:1,2] sRM*/LVINTRO
5 <2> sassign vKS/2
6 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> stub sP
# 4 <0> padsv[$a:1,2] sRM*/LVINTRO
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> stub sP
4 <#> gvsv[*a] s/OURINTR
5 <2> sassign vKS/2
6 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> stub sP
# 4 <$> gvsv(*a) s/OURINTR
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-1 <0> enter
+1 <0> enter v
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> stub sP
4 <#> gvsv[*c] s/LVINTRO
5 <2> sassign vKS/2
6 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> stub sP
# 4 <$> gvsv(*c) s/LVINTRO
bcopts => '-exec',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <0> padrange[$a:1,2; $b:1,2] RM/LVINTRO,range=2
# 5 <2> aassign[t3] vKS
# 6 <@> leave[1 ref] vKP/REFC
EOT_EOT
-# 1 <0> enter
+# 1 <0> enter v
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> pushmark s
# 4 <0> padrange[$a:1,2; $b:1,2] RM/LVINTRO,range=2
REFCNT = 1
|
2 +--enter OP(0xNNN) ===> 3 [nextstate 0xNNN]
- | FLAGS = (UNKNOWN,SLABBED,MORESIB)
+ | FLAGS = (VOID,SLABBED,MORESIB)
|
3 +--nextstate COP(0xNNN) ===> 4 [pushmark 0xNNN]
| FLAGS = (VOID,SLABBED,MORESIB)
/* ------------------ 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;
+ assert(cxstack[cxix].blk_gimme & G_WANT);
+ return (cxstack[cxix].blk_gimme & G_WANT);
+}
+
/* Enter a block. Push a new base context and return its address. */
PERL_ARGS_ASSERT_CX_PUSHSUB;
PERL_DTRACE_PROBE_ENTRY(cv);
+ cx->blk_sub.old_cxsubix = PL_curstackinfo->si_cxsubix;
+ PL_curstackinfo->si_cxsubix = cx - PL_curstackinfo->si_cxstack;
cx->blk_sub.cv = cv;
cx->blk_sub.olddepth = CvDEPTH(cv);
cx->blk_sub.prevcomppad = PL_comppad;
CvDEPTH(cv) = cx->blk_sub.olddepth;
cx->blk_sub.cv = NULL;
SvREFCNT_dec(cv);
+ PL_curstackinfo->si_cxsubix = cx->blk_sub.old_cxsubix;
}
{
PERL_ARGS_ASSERT_CX_PUSHFORMAT;
+ cx->blk_format.old_cxsubix = PL_curstackinfo->si_cxsubix;
+ PL_curstackinfo->si_cxsubix= cx - PL_curstackinfo->si_cxstack;
cx->blk_format.cv = cv;
cx->blk_format.retop = retop;
cx->blk_format.gv = gv;
cx->blk_format.cv = NULL;
--CvDEPTH(cv);
SvREFCNT_dec_NN(cv);
+ PL_curstackinfo->si_cxsubix = cx->blk_format.old_cxsubix;
}
{
PERL_ARGS_ASSERT_CX_PUSHEVAL;
+ cx->blk_eval.old_cxsubix = PL_curstackinfo->si_cxsubix;
+ PL_curstackinfo->si_cxsubix= cx - PL_curstackinfo->si_cxstack;
cx->blk_eval.retop = retop;
cx->blk_eval.old_namesv = namesv;
cx->blk_eval.old_eval_root = PL_eval_root;
cx->blk_eval.old_namesv = NULL;
SvREFCNT_dec_NN(sv);
}
+ PL_curstackinfo->si_cxsubix = cx->blk_eval.old_cxsubix;
}
dVAR;
if (o) {
if (o->op_flags & OPf_PARENS || PERLDB_NOOPT || TAINTING_get) {
- o = op_prepend_elem(OP_LINESEQ, newOP(OP_ENTER, 0), o);
+ o = op_prepend_elem(OP_LINESEQ,
+ newOP(OP_ENTER, (o->op_flags & OPf_WANT)), o);
OpTYPE_set(o, OP_LEAVE);
}
else if (o->op_type == OP_LINESEQ) {
=cut
*/
-#define GIMME_V OP_GIMME(PL_op, block_gimme())
+#define GIMME_V Perl_gimme_V(aTHX)
/* Public flags */
=item *
-XXX
+Added the C<<PL_curstackinfo->si_cxsubix>> field. This records the stack
+index of the most recently pushed sub/format/eval context. It is set and
+restored automatically by C<cx_pushsub()>, C<cx_popsub()> etc., but would
+need to be manually managed if you do any unusual manipulation of the
+context stack.
=back
#define RUN_PP_CATCHABLY(thispp) \
STMT_START { if (CATCH_GET) return docatch(thispp); } STMT_END
+#define dopopto_cursub() \
+ (PL_curstackinfo->si_cxsubix >= 0 \
+ ? PL_curstackinfo->si_cxsubix \
+ : dopoptosub_at(cxstack, cxstack_ix))
+
#define dopoptosub(plop) dopoptosub_at(cxstack, (plop))
PP(pp_wantarray)
if (!(cx = caller_cx(1,NULL))) RETPUSHUNDEF;
}
else {
- cxix = dopoptosub(cxstack_ix);
+ cxix = dopopto_cursub();
if (cxix < 0)
RETPUSHUNDEF;
cx = &cxstack[cxix];
return (gimme == G_VOID) ? G_SCALAR : gimme;
}
+/* note that this function has mostly been superseded by Perl_gimme_V */
+
U8
Perl_block_gimme(pTHX)
{
- const I32 cxix = dopoptosub(cxstack_ix);
+ const I32 cxix = dopopto_cursub();
U8 gimme;
if (cxix < 0)
return G_VOID;
I32
Perl_is_lvalue_sub(pTHX)
{
- const I32 cxix = dopoptosub(cxstack_ix);
+ const I32 cxix = dopopto_cursub();
assert(cxix >= 0); /* We should only be called from inside subs */
if (CxLVAL(cxstack + cxix) && CvLVALUE(cxstack[cxix].blk_sub.cv))
const PERL_CONTEXT *
Perl_caller_cx(pTHX_ I32 count, const PERL_CONTEXT **dbcxp)
{
- I32 cxix = dopoptosub(cxstack_ix);
+ I32 cxix = dopopto_cursub();
const PERL_CONTEXT *cx;
const PERL_CONTEXT *ccstack = cxstack;
const PERL_SI *top_si = PL_curstackinfo;
{
dSP; dMARK;
PERL_CONTEXT *cx;
- const I32 cxix = dopoptosub(cxstack_ix);
+ const I32 cxix = dopopto_cursub();
assert(cxstack_ix >= 0);
if (cxix < cxstack_ix) {
DIE(aTHX_ "Goto undefined subroutine");
}
- cxix = dopoptosub(cxstack_ix);
+ cxix = dopopto_cursub();
if (cxix < 0) {
DIE(aTHX_ "Can't goto subroutine outside a subroutine");
}
#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)
si->si_next = 0;
si->si_cxmax = cxitems - 1;
si->si_cxix = -1;
+ si->si_cxsubix = -1;
si->si_type = PERLSI_UNDEF;
Newx(si->si_cxstack, cxitems, PERL_CONTEXT);
/* Without any kind of initialising CX_PUSHSUBST()
nsi->si_stack = av_dup_inc(si->si_stack, param);
nsi->si_cxix = si->si_cxix;
+ nsi->si_cxsubix = si->si_cxsubix;
nsi->si_cxmax = si->si_cxmax;
nsi->si_cxstack = cx_dup(si->si_cxstack, si->si_cxix, si->si_cxmax, param);
nsi->si_type = si->si_type;
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 {}',