From c369d436bece8b3ff60768897e88a7f40fdb877d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 29 Feb 2024 15:07:25 -0500 Subject: Fix caching for loaded Lua require() modules. The code to save the loaded module was using the wrong key. --- indra/newview/llluamanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp index 80d7eb4210..cd663021a1 100644 --- a/indra/newview/llluamanager.cpp +++ b/indra/newview/llluamanager.cpp @@ -463,7 +463,7 @@ bool LLRequireResolver::findModuleImpl(const std::string& absolutePath) for (const auto& suffixedPath : possibleSuffixedPaths) { // Check _MODULES cache for module - lua_getfield(L, -1, suffixedPath.c_str()); + lua_getfield(L, -1, suffixedPath.data()); if (!lua_isnil(L, -1)) { return true; @@ -485,7 +485,7 @@ bool LLRequireResolver::findModuleImpl(const std::string& absolutePath) // duplicate the new module: _MODULES newmodule newmodule lua_pushvalue(L, -1); // store _MODULES[found path] = newmodule - lua_setfield(L, -3, source.data()); + lua_setfield(L, -3, suffixedPath.data()); return true; } -- cgit v1.2.3