summaryrefslogtreecommitdiff
path: root/dev-cpp/sol2/files/sol2-3.5.0-iterend.patch
diff options
context:
space:
mode:
authorAlexey Sokolov <alexey+gentoo@asokolov.org>2025-05-16 23:17:09 +0100
committerSam James <sam@gentoo.org>2025-05-16 23:37:39 +0100
commitd505755847920dd39253b39636f03486e1f6a426 (patch)
tree4128274d3cce9e09c7708a94615857430678ef8d /dev-cpp/sol2/files/sol2-3.5.0-iterend.patch
parent2301daaf547f83a104767c0302f7e526be747ae5 (diff)
downloadgentoo-d505755847920dd39253b39636f03486e1f6a426.tar.gz
gentoo-d505755847920dd39253b39636f03486e1f6a426.tar.bz2
gentoo-d505755847920dd39253b39636f03486e1f6a426.zip
dev-cpp/sol2: fix build
Closes: https://bugs.gentoo.org/955999 Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org> Part-of: https://github.com/gentoo/gentoo/pull/42123 Closes: https://github.com/gentoo/gentoo/pull/42123 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-cpp/sol2/files/sol2-3.5.0-iterend.patch')
-rw-r--r--dev-cpp/sol2/files/sol2-3.5.0-iterend.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/dev-cpp/sol2/files/sol2-3.5.0-iterend.patch b/dev-cpp/sol2/files/sol2-3.5.0-iterend.patch
new file mode 100644
index 000000000000..b7e8a1c4fcbf
--- /dev/null
+++ b/dev-cpp/sol2/files/sol2-3.5.0-iterend.patch
@@ -0,0 +1,58 @@
+https://github.com/ThePhD/sol2/pull/1676
+https://bugs.gentoo.org/955999
+
+From 8f80cd79f60613b96c877cec2bba3efee2a78225 Mon Sep 17 00:00:00 2001
+From: martin nylin <martin.nylin@gmail.com>
+Date: Tue, 11 Mar 2025 20:58:43 +0100
+Subject: [PATCH 1/2] Change end() to sen() in usertype_container.hpp
+
+---
+ include/sol/usertype_container.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/sol/usertype_container.hpp b/include/sol/usertype_container.hpp
+index 6d25d2a8..3ff81724 100644
+--- a/include/sol/usertype_container.hpp
++++ b/include/sol/usertype_container.hpp
+@@ -1189,7 +1189,7 @@ namespace sol {
+ static int next_associative(std::true_type, lua_State* L_) {
+ iter& i = stack::unqualified_get<user<iter>>(L_, 1);
+ auto& it = i.it();
+- auto& end = i.end();
++ auto& end = i.sen();
+ if (it == end) {
+ return stack::push(L_, lua_nil);
+ }
+
+From a6872ef46b08704b9069ebf83161f4637459ce63 Mon Sep 17 00:00:00 2001
+From: martin nylin <martin.nylin@gmail.com>
+Date: Tue, 11 Mar 2025 21:28:44 +0100
+Subject: [PATCH 2/2] Fix array index out of bounds in stack_field.hpp
+
+---
+ include/sol/stack_field.hpp | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/include/sol/stack_field.hpp b/include/sol/stack_field.hpp
+index 9dd66e2e..3b815225 100644
+--- a/include/sol/stack_field.hpp
++++ b/include/sol/stack_field.hpp
+@@ -113,7 +113,17 @@ namespace sol { namespace stack {
+ lua_getglobal(L, &key[0]);
+ }
+ else {
+- lua_getfield(L, tableindex, &key[0]);
++ if constexpr (std::is_same_v<std::decay_t<Key>, const char*>) {
++ // Handle const char* case
++ if (key != nullptr) {
++ lua_getfield(L, tableindex, key);
++ } else {
++ push(L, lua_nil);
++ }
++ } else {
++ // Handle std::string case
++ lua_getfield(L, tableindex, key.c_str());
++ }
+ }
+ }
+ else if constexpr (std::is_same_v<T, meta_function>) {