summaryrefslogtreecommitdiff
path: root/indra/llcommon/lua_function.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-06-18 18:09:16 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-06-18 18:09:16 -0400
commitb7a70eb7ee3451dae596ddd691666eb83ac9350c (patch)
tree4f412c6eca5d066157502826ee64efb8b8010332 /indra/llcommon/lua_function.cpp
parentbac8ced279bb4b3ec49e497b75021b86a0b4d857 (diff)
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.
Diffstat (limited to 'indra/llcommon/lua_function.cpp')
-rw-r--r--indra/llcommon/lua_function.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}