summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
authorTomasz Konojacki <me@xenu.pl>2020-04-27 08:31:47 +0200
committerTony Cook <tony@develop-help.com>2020-08-03 06:19:35 +0000
commit313464947382fab07299af0061f419a55540356a (patch)
tree06c8305bac846db77cef114d14e094d8e5761cdd /XSUB.h
parent190ae7ea95828d4b9266cb3fdbc0d1d1a989e963 (diff)
downloadperl-313464947382fab07299af0061f419a55540356a.tar.gz
XSUB.h: fix MARK and items variables inside BOOT XSUBs
ax was incremented by Perl_xs_handshake() and because of that MARK and items were off by one inside BOOT XSUBs. fixes #17755
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/XSUB.h b/XSUB.h
index e3147ce9fb..5f17a5acde 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -160,16 +160,16 @@ is a lexical C<$_> in scope.
PL_xsubfilename. */
#define dXSBOOTARGSXSAPIVERCHK \
I32 ax = XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
- SV **mark = PL_stack_base + ax; dSP; dITEMS
+ SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
#define dXSBOOTARGSAPIVERCHK \
I32 ax = XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
- SV **mark = PL_stack_base + ax; dSP; dITEMS
+ SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
/* dXSBOOTARGSNOVERCHK has no API in xsubpp to choose it so do
#undef dXSBOOTARGSXSAPIVERCHK
#define dXSBOOTARGSXSAPIVERCHK dXSBOOTARGSNOVERCHK */
#define dXSBOOTARGSNOVERCHK \
I32 ax = XS_SETXSUBFN_POPMARK; \
- SV **mark = PL_stack_base + ax; dSP; dITEMS
+ SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
#define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
? PAD_SV(PL_op->op_targ) : sv_newmortal())