Fix a number of arguments passed to a BOOT XS subroutine

This commit is contained in:
Petr Písař 2020-08-05 13:58:42 +02:00
parent 524db83618
commit c8ae198cc9
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,45 @@
From 313464947382fab07299af0061f419a55540356a Mon Sep 17 00:00:00 2001
From: Tomasz Konojacki <me@xenu.pl>
Date: Mon, 27 Apr 2020 08:31:47 +0200
Subject: [PATCH] XSUB.h: fix MARK and items variables inside BOOT XSUBs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
ax was incremented by Perl_xs_handshake() and because of that
MARK and items were off by one inside BOOT XSUBs.
fixes #17755
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
XSUB.h | 6 +++---
1 file 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())
--
2.25.4

View File

@ -205,6 +205,10 @@ Patch26: perl-5.33.0-reentr.c-Prevent-infinite-looping.patch
# in upstream after 5.33.0
Patch27: perl-5.33.0-perl-17844-don-t-update-SvCUR-until-after-we-ve-done.patch
# Fix a number of arguments passed to a BOOT XS subroutine, GH#17755,
# in upstream after 5.33.0
Patch28: perl-5.33.0-XSUB.h-fix-MARK-and-items-variables-inside-BOOT-XSUB.patch
# Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
@ -4218,6 +4222,7 @@ you're not running VMS, this module does nothing.
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch200 -p1
%patch201 -p1
@ -4252,6 +4257,7 @@ perl -x patchlevel.h \
'Fedora Patch25: Fix a buffer size for asctime_r() and ctime_r() functions' \
'Fedora Patch26: Prevent from an integer overflow in RenewDouble() macro' \
'Fedora Patch27: Fix a buffer overread in when reallocating formats (GH#17844)' \
'Fedora Patch28: Fix a number of arguments passed to a BOOT XS subroutine (GH#17755)' \
'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \
'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
%{nil}
@ -6981,6 +6987,7 @@ popd
- Fix a buffer size for asctime_r() and ctime_r() functions
- Prevent from an integer overflow in RenewDouble() macro
- Fix a buffer overread in when reallocating formats (GH#17844)
- Fix a number of arguments passed to a BOOT XS subroutine (GH#17755)
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4:5.32.0-458
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild