From b7a70eb7ee3451dae596ddd691666eb83ac9350c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 18 Jun 2024 18:09:16 -0400 Subject: Initialize lua_Debug lluau::source_path() passes to lua_getinfo(). On Mac it doesn't seem to matter, but on Windows, leaving it uninitialized can produce garbage results and even crash the coroutine. This seems strange, since we've been assuming lua_getinfo() treats its lua_Debug* as output-only. --- indra/llcommon/lua_function.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/lua_function.cpp b/indra/llcommon/lua_function.cpp index 3e3934c9c1..283dfa3c94 100644 --- a/indra/llcommon/lua_function.cpp +++ b/indra/llcommon/lua_function.cpp @@ -78,7 +78,7 @@ fsyspath lluau::source_path(lua_State* L) // In particular: // passing level=1 gets you info about the deepest function call // passing level=lua_stackdepth() gets you info about the topmost script - lua_Debug ar; + lua_Debug ar{}; lua_getinfo(L, lua_stackdepth(L), "s", &ar); return ar.source; } -- cgit v1.2.3