Add null-pointer checks when accessing a TypeSystem's SymbolFile
authorAugusto Noronha <augusto2112@me.com>
Tue, 11 May 2021 16:15:03 +0000 (13:15 -0300)
committerAugusto Noronha <augusto2112@me.com>
Tue, 11 May 2021 16:15:20 +0000 (13:15 -0300)
commitec28e43e01540a57f8822b2efb8638996873f945
tree070b4b1d869320e90cabd9ef12ab01f5baaf171d
parent6c82b8a378a6f59e94a81d91225db4fabf6e2bff
Add null-pointer checks when accessing a TypeSystem's SymbolFile

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.

Reviewed By: aprantl, teemperor

Differential Revision: https://reviews.llvm.org/D101539
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Symbol/Type.cpp
lldb/unittests/Symbol/TestTypeSystemClang.cpp