I added these earlier as a way of compiling the code under both 5.23.7 and
5.23.8, since the latter no longer has the argarray field in the context
struct. I didn't know at the time whether they were logically correct
under 5.23.8 - I just wanted the code to compile.
Having now properly fixed uplevel() to work on 5.23.8, and since uplevel
under 5.23.8 uses an entirely separate code path, only 5.23.7 and earlier
make use of CX_ARGARRAY() and _set(), so eliminate these macros and
revert back to the original usage (i.e. cx->blk_sub.argarray).
# define NEGATIVE_INDICES_VAR "NEGATIVE_INDICES"
#endif
# define NEGATIVE_INDICES_VAR "NEGATIVE_INDICES"
#endif
-/* CX_ARGARRAY(cx): the AV at pad[0] of the CV associated with CXt_SUB
- * context cx */
-
-#if XSH_HAS_PERL(5, 23, 8)
-# define CX_ARGARRAY(cx) \
- ((AV*)(AvARRAY(MUTABLE_AV( \
- PadlistARRAY(CvPADLIST(cx->blk_sub.cv))[ \
- CvDEPTH(cx->blk_sub.cv)]))[0]))
-# define CX_ARGARRAY_set(cx,ary) \
- (AvARRAY(MUTABLE_AV( \
- PadlistARRAY(CvPADLIST(cx->blk_sub.cv))[ \
- CvDEPTH(cx->blk_sub.cv)]))[0] = (SV*)(ary))
-#else
-# define CX_ARGARRAY(cx) (cx->blk_sub.argarray)
-# define CX_ARGARRAY_set(cx,ary) (cx->blk_sub.argarray = (ary))
-#endif
-
-
/* --- Error messages ------------------------------------------------------ */
static const char su_stack_smash[] = "Cannot target a scope outside of the current stack";
/* --- Error messages ------------------------------------------------------ */
static const char su_stack_smash[] = "Cannot target a scope outside of the current stack";
switch (CxTYPE(cx)) {
case CXt_SUB:
if (CxHASARGS(cx)) {
switch (CxTYPE(cx)) {
case CXt_SUB:
if (CxHASARGS(cx)) {
- argarray = CX_ARGARRAY(cx);
+ argarray = cx->blk_sub.argarray;
* reached without a goto() happening, and the old argarray member is
* actually our fake argarray. Destroy it properly in that case. */
if (cx->blk_sub.cv == sud->renamed) {
* reached without a goto() happening, and the old argarray member is
* actually our fake argarray. Destroy it properly in that case. */
if (cx->blk_sub.cv == sud->renamed) {
- SvREFCNT_dec(CX_ARGARRAY(cx));
- CX_ARGARRAY_set(cx, argarray);
+ SvREFCNT_dec(cx->blk_sub.argarray);
+ cx->blk_sub.argarray = argarray;
}
CvDEPTH(sud->callback)--;
}
CvDEPTH(sud->callback)--;
if ((PL_op = PL_ppaddr[OP_ENTERSUB](aTHX))) {
PERL_CONTEXT *sub_cx = cxstack + cxstack_ix;
if ((PL_op = PL_ppaddr[OP_ENTERSUB](aTHX))) {
PERL_CONTEXT *sub_cx = cxstack + cxstack_ix;
- AV *argarray = CX_ARGARRAY(cx);
+ AV *argarray = cx->blk_sub.argarray;
/* If pp_entersub() returns a non-null OP, it means that the callback is not
* an XSUB. */
/* If pp_entersub() returns a non-null OP, it means that the callback is not
* an XSUB. */
av_extend(av, AvMAX(argarray));
AvFILLp(av) = AvFILLp(argarray);
Copy(AvARRAY(argarray), AvARRAY(av), AvFILLp(av) + 1, SV *);
av_extend(av, AvMAX(argarray));
AvFILLp(av) = AvFILLp(argarray);
Copy(AvARRAY(argarray), AvARRAY(av), AvFILLp(av) + 1, SV *);
- CX_ARGARRAY_set(sub_cx, av);
+ sub_cx->blk_sub.argarray = av;
- SvREFCNT_inc_simple_void(CX_ARGARRAY(sub_cx));
+ SvREFCNT_inc_simple_void(sub_cx->blk_sub.argarray);
}
if (su_uplevel_goto_static(CvROOT(renamed))) {
}
if (su_uplevel_goto_static(CvROOT(renamed))) {