diff options
author | Sam James <sam@gentoo.org> | 2023-10-17 10:13:09 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-10-17 10:13:09 +0100 |
commit | 1f721528f36fd090e3338b5293918323caf30900 (patch) | |
tree | 394cae60372a1b505ca88100737d86b32d73ce11 /dev-lang/lua | |
parent | sys-fs/zfs: fix patches for live (diff) | |
download | gentoo-1f721528f36fd090e3338b5293918323caf30900.tar.gz gentoo-1f721528f36fd090e3338b5293918323caf30900.tar.bz2 gentoo-1f721528f36fd090e3338b5293918323caf30900.zip |
dev-lang/lua: fix tests on sparc
Backport upstream patch to fix sparc tests. This just drops the bad test and
makes a semantically-identical change to another function, so no revbump needed.
Closes: https://bugs.gentoo.org/914562
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/lua')
-rw-r--r-- | dev-lang/lua/files/lua-5.4.6-sparc-tests.patch | 44 | ||||
-rw-r--r-- | dev-lang/lua/lua-5.4.6.ebuild | 5 |
2 files changed, 49 insertions, 0 deletions
diff --git a/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch b/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch new file mode 100644 index 000000000000..29515aad1639 --- /dev/null +++ b/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch @@ -0,0 +1,44 @@ +https://github.com/lua/lua/commit/6baee9ef9d5657ab582c8a4b9f885ec58ed502d0 +https://bugs.gentoo.org/914562 + +From 6baee9ef9d5657ab582c8a4b9f885ec58ed502d0 Mon Sep 17 00:00:00 2001 +From: Roberto Ierusalimschy <roberto@inf.puc-rio.br> +Date: Fri, 8 Sep 2023 16:19:21 -0300 +Subject: [PATCH] Removed test for "corrupted binary dump" + +Test is too non portable. (For instance, it does not work for +different number types.) +--- a/src/lundump.c ++++ b/src/lundump.c +@@ -81,7 +81,7 @@ static size_t loadUnsigned (LoadState *S, size_t limit) { + + + static size_t loadSize (LoadState *S) { +- return loadUnsigned(S, ~(size_t)0); ++ return loadUnsigned(S, MAX_SIZET); + } + + +--- a/tests/calls.lua ++++ b/tests/calls.lua +@@ -342,20 +342,6 @@ do -- another bug (in 5.4.0) + end + + +-do -- another bug (since 5.2) +- -- corrupted binary dump: list of upvalue names is larger than number +- -- of upvalues, overflowing the array of upvalues. +- local code = +- "\x1b\x4c\x75\x61\x54\x00\x19\x93\x0d\x0a\x1a\x0a\x04\x08\x08\x78\x56\z +- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x77\x40\x00\x86\x40\z +- \x74\x65\x6d\x70\x81\x81\x01\x00\x02\x82\x48\x00\x02\x00\xc7\x00\x01\z +- \x00\x80\x80\x80\x82\x00\x00\x80\x81\x82\x78\x80\x82\x81\x86\x40\x74\z +- \x65\x6d\x70" +- +- assert(load(code)) -- segfaults in previous versions +-end +- +- + x = string.dump(load("x = 1; return x")) + a = assert(load(read1(x), nil, "b")) + assert(a() == 1 and _G.x == 1) diff --git a/dev-lang/lua/lua-5.4.6.ebuild b/dev-lang/lua/lua-5.4.6.ebuild index c7fd11588774..c5d1c9109b73 100644 --- a/dev-lang/lua/lua-5.4.6.ebuild +++ b/dev-lang/lua/lua-5.4.6.ebuild @@ -22,6 +22,11 @@ DEPEND=" RDEPEND="${DEPEND}" BDEPEND="virtual/pkgconfig" +PATCHES=( + # Backported variant of upstream patch to fix sparc tests, bug #914562 + "${FILESDIR}"/${PN}-5.4.6-sparc-tests.patch +) + src_prepare() { default |