[Lldb-commits] [lldb] [lldb] Fix LuaState after #205210 (PR #205219)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 22 16:46:09 PDT 2026


================
@@ -149,8 +149,8 @@ llvm::Error LuaState::LoadModule(llvm::StringRef filename) {
     return e;
   }
 
-  ConstString module_name = file.GetFileNameStrippingExtension();
-  lua_setglobal(m_lua_state, module_name.GetCString());
+  llvm::StringRef module_name = file.GetFileNameStrippingExtension();
----------------
bulbazord wrote:

This isn't guaranteed to be a c-string... E.g. `foo.dylib` will give you a StringRef to `foo` but the character right after the second `o` will be `.`.

You probably want to create a temporary `std::string` and get its c string from that.

https://github.com/llvm/llvm-project/pull/205219


More information about the lldb-commits mailing list