================
@@ -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
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits