Skip to content

Commit f2fd010

Browse files
committed
Add missing lua_remove when discovering function name
1 parent 0619f26 commit f2fd010

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mlua-sys/src/luau/compat.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ unsafe fn compat53_pushfuncname(L: *mut lua_State, L1: *mut lua_State, level: c_
8585
lua_pushfstring(L, cstr!("function '%s'"), (*ar).name);
8686
} else if compat53_pushglobalfuncname(L, L1, level, ar) != 0 {
8787
lua_pushfstring(L, cstr!("function '%s'"), lua_tostring(L, -1));
88+
lua_remove(L, -2); // remove name
8889
} else if *(*ar).what != b'C' as c_char {
8990
// for Lua functions, use <file:line>
9091
lua_pushfstring(L, cstr!("function <%s:%d>"), (*ar).short_src, (*ar).linedefined);

0 commit comments

Comments
 (0)