[Lldb-commits] [PATCH] D101539: Add null-pointer checks when accessing a TypeSystem's SymbolFile

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 10 13:42:39 PDT 2021


teemperor accepted this revision.
teemperor added a comment.

LGTM, just some nits and please address the clang-format issue.



================
Comment at: lldb/unittests/Symbol/TestTypeSystemClang.cpp:747
+TEST_F(TestTypeSystemClang, GetExeModuleWhenMissingSymbolFile) {
+  auto compiler_type = m_ast->GetBasicTypeFromAST(lldb::eBasicTypeInt);
+  lldb_private::Type t(0, nullptr, ConstString("MyType"), llvm::None, nullptr,
----------------
Can you make that `CompilerType`? (Just because it's not clear what this returns, e.g. Type or CompilerType)


================
Comment at: lldb/unittests/Symbol/TestTypeSystemClang.cpp:753
+  // is handled gracefully.
+  auto module = t.GetExeModule();
+}
----------------
Can you also spell out the auto type and check that this is a nullptr? `EXPECT_EQ(module, nullptr);` Right now this could return some random pointer and pass.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101539



More information about the lldb-commits mailing list