summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-02-29 15:07:25 -0500
committerNat Goodspeed <nat@lindenlab.com>2024-02-29 15:07:25 -0500
commitc369d436bece8b3ff60768897e88a7f40fdb877d (patch)
tree06b30762b8a0f9e74a3f3c18b773a148410d660f /indra
parent9bf2837505b7384ac18f1ae23de256729f561dfc (diff)
Fix caching for loaded Lua require() modules.
The code to save the loaded module was using the wrong key.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llluamanager.cpp4
1 files 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;
}