A type system is not guaranteed to have a symbol file. This patch adds null-pointer checks so we don't crash when trying to access a type system's symbol file.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
General question, is it possible to write a test for this? (I've not looked into this area of code before)
TypeSystemClang can be unit-tested just fine these days. It should also be possible to test Type (You can just model a random 'int' type from a TypeSystemClang instance).
@teemperor let me know if this test is OK, or if there's a better way to test this :)
LGTM, just some nits and please address the clang-format issue.
lldb/unittests/Symbol/TestTypeSystemClang.cpp | ||
---|---|---|
746 | Can you make that CompilerType? (Just because it's not clear what this returns, e.g. Type or CompilerType) | |
752 | 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. |
Can you make that CompilerType? (Just because it's not clear what this returns, e.g. Type or CompilerType)