[cfe-commits] r163566 - /cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Tue Sep 11 00:29:55 PDT 2012
On 11.09.2012 01:44, Jordan Rose wrote:
> On Sep 10, 2012, at 16:28 , Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
>
>> 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!");
> llvm_unreachable? Also, how is this any different than what you had before?
>
This one won't crash in release mode. Making the else llvm_unreachable
would probably cause the optimizer to optimize the branch away, though.
Sebastian
More information about the cfe-commits
mailing list