[PATCH][lldb] Fix dereference of null pointer.
authorCaroline Tice <cmtice@google.com>
Mon, 10 Apr 2023 21:45:59 +0000 (14:45 -0700)
committerCaroline Tice <cmtice@google.com>
Tue, 11 Apr 2023 20:33:03 +0000 (13:33 -0700)
commit1fa26e64fd87c848ff54d08e9a14ea03e01ae645
tree4595f8a005b52e17eef1bab45a7550833413887a
parenta0525f09ac1eda3fbb74e8708b3aa5b7379df0c2
[PATCH][lldb] Fix dereference of null pointer.

The function DWARFASTParserClang::ParsePointerToMemberType attempts to make
two pointers and then immediately tries to dereference them, without
verifying that the pointesr were successfully created. Sometimes the pointer
creation fails, and the dereference then causes a segfault. This add a check
that the pointers are non-null before attempting to dereference them.
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/test/Shell/SymbolFile/DWARF/x86/class-type-nullptr-deref.s [new file with mode: 0644]