[modules] Fix an iterator invalidation bug found by the modules selfhost bot.

llvm-svn: 233007
This commit is contained in:
Richard Smith 2015-03-23 19:54:56 +00:00
parent 96cedb52b3
commit 7226f2a497
1 changed files with 8 additions and 4 deletions

View File

@ -8618,10 +8618,14 @@ void ASTReader::FinishedDeserializing() {
if (NumCurrentElementsDeserializing == 0) {
// Propagate exception specification updates along redeclaration chains.
for (auto Update : PendingExceptionSpecUpdates) {
auto *FPT = Update.second->getType()->castAs<FunctionProtoType>();
SemaObj->UpdateExceptionSpec(Update.second,
FPT->getExtProtoInfo().ExceptionSpec);
while (!PendingExceptionSpecUpdates.empty()) {
auto Updates = std::move(PendingExceptionSpecUpdates);
PendingExceptionSpecUpdates.clear();
for (auto Update : Updates) {
auto *FPT = Update.second->getType()->castAs<FunctionProtoType>();
SemaObj->UpdateExceptionSpec(Update.second,
FPT->getExtProtoInfo().ExceptionSpec);
}
}
diagnoseOdrViolations();