diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp b/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp --- a/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp @@ -18,7 +18,7 @@ int error = luaL_loadbuffer(m_lua_state, buffer.data(), buffer.size(), "buffer") || lua_pcall(m_lua_state, 0, 0, 0); - if (!error) + if (error == LUA_OK) return llvm::Error::success(); llvm::Error e = llvm::make_error( @@ -44,7 +44,7 @@ int error = luaL_loadfile(m_lua_state, filename.data()) || lua_pcall(m_lua_state, 0, 1, 0); - if (error) { + if (error != LUA_OK) { llvm::Error e = llvm::make_error( llvm::formatv("{0}\n", lua_tostring(m_lua_state, -1)), llvm::inconvertibleErrorCode());