From 569315a23c3ba56358b54ae1ea11539965839f8d Mon Sep 17 00:00:00 2001 From: IonutParau Date: Wed, 2 Jul 2025 00:01:32 +0200 Subject: [PATCH] fixed some optimizer UB --- src/testLuaArch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/testLuaArch.c b/src/testLuaArch.c index 8f40d74..78bb0f2 100644 --- a/src/testLuaArch.c +++ b/src/testLuaArch.c @@ -3,13 +3,14 @@ #include #include #include -#include #include "neonucleus.h" char *testLuaSandbox = NULL; #if LUA_VERSION_NUM == 502 +#include + // monkey patching bool lua_isinteger(lua_State *L, int i) { @@ -505,7 +506,7 @@ int testLuaArch_unicode_sub(lua_State *L) { } char *sub = nn_unicode_char(points + start - 1, stop - start + 1); - char *res = testLuaArch_pushstring(L, sub); + const char *res = testLuaArch_pushstring(L, sub); nn_free(sub); nn_free(points); if (!res) { @@ -531,7 +532,7 @@ int testLuaArch_unicode_char(lua_State *L) { codepoints[i] = lua_tointeger(L, idx); } char *s = nn_unicode_char(codepoints, argc); - char *res = testLuaArch_pushstring(L, s); + const char *res = testLuaArch_pushstring(L, s); nn_free(s); nn_free(codepoints); if (!res) {