diff options
author | Greg Clayton <gclayton@apple.com> | 2016-05-26 19:24:02 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2016-05-26 19:24:02 +0000 |
commit | 23c12ca9226c297771ba5fefa0f047e9e2450d7b (patch) | |
tree | 0e28e031321a09e1a76ac113424a5e9ea7e86f7b /llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | |
parent | 7ba9baef6ddaa537de83da4e85bf3efc588fb1d7 (diff) | |
download | bcm5719-llvm-23c12ca9226c297771ba5fefa0f047e9e2450d7b.tar.gz bcm5719-llvm-23c12ca9226c297771ba5fefa0f047e9e2450d7b.zip |
Make sure that we succeed in starting a definition before we complete it and emit an error if we fail to start the definition.
ClangASTContext::StartTagDeclarationDefinition(...) was starting definitions for any TagType instances that have TagDecl, but ClangASTContext::CompleteTagDeclarationDefinition(...) was getting the type to a CXXRecordDecl with:
clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
The problem is that getAsCXXRecordDecl() might dig a bit deeper into a type and dig out a different decl, which means we might call ClangASTContext::StartTagDeclarationDefinition(...), but it might not do anything, and then we might call ClangASTContext::CompleteTagDeclarationDefinition(...) and it might try to complete something that didn't have its definition started and this will crash.
This change fixes that, and also makes sure that starting a definition succeeds before any calls to ClangASTContext::CompleteTagDeclarationDefinition().
<rdar://problem/24091798>
llvm-svn: 270891
Diffstat (limited to 'llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp')
0 files changed, 0 insertions, 0 deletions