From f2fd010c5f5b1645201f2d07f1413880bb24dd0a Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Tue, 28 Oct 2025 16:04:24 +0000 Subject: [PATCH] Add missing `lua_remove` when discovering function name --- mlua-sys/src/luau/compat.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/mlua-sys/src/luau/compat.rs b/mlua-sys/src/luau/compat.rs index 9034ae4..582bb43 100644 --- a/mlua-sys/src/luau/compat.rs +++ b/mlua-sys/src/luau/compat.rs @@ -85,6 +85,7 @@ unsafe fn compat53_pushfuncname(L: *mut lua_State, L1: *mut lua_State, level: c_ lua_pushfstring(L, cstr!("function '%s'"), (*ar).name); } else if compat53_pushglobalfuncname(L, L1, level, ar) != 0 { lua_pushfstring(L, cstr!("function '%s'"), lua_tostring(L, -1)); + lua_remove(L, -2); // remove name } else if *(*ar).what != b'C' as c_char { // for Lua functions, use lua_pushfstring(L, cstr!("function <%s:%d>"), (*ar).short_src, (*ar).linedefined);