[Lldb-commits] [PATCH] D90556: [LLDB][NFC] treat Lua error codes in a more explicit manner

Pedro Tammela via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 3 01:40:25 PST 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4b9fa3b705c8: [LLDB][NFC] treat Lua error codes in a more explicit manner (authored by tammela).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90556/new/

https://reviews.llvm.org/D90556

Files:
  lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp


Index: lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp
===================================================================
--- lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp
+++ 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<llvm::StringError>(
@@ -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::StringError>(
         llvm::formatv("{0}\n", lua_tostring(m_lua_state, -1)),
         llvm::inconvertibleErrorCode());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90556.302509.patch
Type: text/x-patch
Size: 854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201103/0953e38b/attachment.bin>


More information about the lldb-commits mailing list