[cfe-commits] r163566 - /cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Sep 10 16:28:22 PDT 2012
Author: akirtzidis
Date: Mon Sep 10 18:28:22 2012
New Revision: 163566
URL: http://llvm.org/viewvc/llvm-project?rev=163566&view=rev
Log:
[PCH] Add a null check to avoid crashing.
Unfortunately, no test case. rdar://11960120
Modified:
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=163566&r1=163565&r2=163566&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Mon Sep 10 18:28:22 2012
@@ -590,8 +590,10 @@
TemplArgs.size(), C);
void *InsertPos = 0;
CanonTemplate->getSpecializations().FindNodeOrInsertPos(ID, InsertPos);
- assert(InsertPos && "Another specialization already inserted!");
- CanonTemplate->getSpecializations().InsertNode(FTInfo, InsertPos);
+ if (InsertPos)
+ CanonTemplate->getSpecializations().InsertNode(FTInfo, InsertPos);
+ else
+ assert(0 && "Another specialization already inserted!");
}
break;
}
More information about the cfe-commits
mailing list