llvm-project/lldb/unittests/SymbolFile/DWARF
Raphael Isemann 73951a11c6 [lldb] Add sanity check to CreateDeclContext and fixed illformed CompilerContext in ClangExpressionDeclMap.
This adds a check that the ClangASTContext actually fits to the
DeclContext that we want to create a CompilerDeclContext for. If
the ClangASTContext (and its associated ASTContext) does not fit
to the DeclContext (that is, the DeclContext wasn't created by the
ASTContext), all computations using this malformed CompilerDeclContext
will yield unpredictable results.

Also fixes the only place that actually hits this assert which is the
construction of a CompilerDeclContext in ClangExpressionDeclMap
where we pass an unrelated ASTContext instead of the ASTContext
of the current expression.

I had to revert my previous change to DWARFASTParserClangTests.cpp
back to using the unsafe direct construction of CompilerDeclContext
as this assert won't work if the DeclContext we pass isn't a valid
DeclContext in the first place.
2019-12-23 11:48:02 +01:00
..
Inputs
CMakeLists.txt Fix GetDIEForDeclContext so it only returns entries matching the provided context 2019-08-29 15:30:52 +00:00
DWARFASTParserClangTests.cpp [lldb] Add sanity check to CreateDeclContext and fixed illformed CompilerContext in ClangExpressionDeclMap. 2019-12-23 11:48:02 +01:00
SymbolFileDWARFTests.cpp [lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests 2019-12-23 10:38:25 +01:00