adc5168d71
The `UBSAN`/`ASAN` plugins would previously call the internal helper structure injected into the source expression `struct data { ... };` This occasionally collided with user-defined types of the same (quite common) name. In the presence of varibale with the same name LLDB would simply fail to run the injected `InstrumentationRuntime` expressions with: ``` warning: cannot evaluate AddressSanitizer expression: expression failed to parse: error: <user expression 2>:2:5: must use 'struct' tag to refer to type 'data' in this scope data t; ``` In the presence of another type called 'data', LLDB would most likely crash with something like: ``` 0x00000001198de614 clang::ASTNodeImporter::ImportDeclContext(clang::DeclContext*, bool) + 1088 0x00000001198de614 clang::ASTNodeImporter::ImportDeclContext(clang::DeclContext*, bool) + 1088 0x0000000119907930 clang::ASTImporter::ImportDefinition(clang::Decl*) + 596 0x00000001163db928 lldb_private::ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo(clang::Decl*, clang::Decl*) + 100 0x00000001163da070 (anonymous namespace)::CompleteTagDeclsScope::~CompleteTagDeclsScope() + 572 ... ``` ...because it got the types confused. This patch makes these structures anonymous so there's no chance of clashing with other types in the program. This is already the approach taken in `UBSan/InstrumentationRuntimeABSan.cpp`. **Testing** - API tests still pass - Tested manually that the `memory history` command now works in the presence of a local called `data` Differential Revision: https://reviews.llvm.org/D145569 |
||
---|---|---|
.. | ||
ASan | ||
MainThreadChecker | ||
TSan | ||
UBSan | ||
CMakeLists.txt |