summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-07 06:38:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-07 06:38:20 +0000
commita9a1c68a1bcba94f8d5c6cf5ea5619b0e2eedfce (patch)
tree9960c190d3d42c07bfb00db452e60687b3784cd9 /clang/lib/Serialization/ASTReaderDecl.cpp
parentf456e442114973b8f0866f88c694bf0b6697a7ca (diff)
downloadbcm5719-llvm-a9a1c68a1bcba94f8d5c6cf5ea5619b0e2eedfce.tar.gz
bcm5719-llvm-a9a1c68a1bcba94f8d5c6cf5ea5619b0e2eedfce.zip
Fix an iterator invalidation issue: deserializing a key function can write to
the key functions table. Don't hold references to anything within that table across such an access. llvm-svn: 212437
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index beffe06590c..d8495da1bac 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -1479,6 +1479,9 @@ ASTDeclReader::VisitCXXRecordDeclImpl(CXXRecordDecl *D) {
if (WasDefinition) {
DeclID KeyFn = ReadDeclID(Record, Idx);
if (KeyFn && D->IsCompleteDefinition)
+ // FIXME: This is wrong for the ARM ABI, where some other module may have
+ // made this function no longer be a key function. We need an update
+ // record or similar for that case.
C.KeyFunctions[D] = KeyFn;
}
OpenPOWER on IntegriCloud