[cfe-commits] r163566 - /cfe/trunk/lib/Serialization/ASTReaderDecl.cpp

Jordan Rose jordan_rose at apple.com
Mon Sep 10 16:44:10 PDT 2012


On Sep 10, 2012, at 16:28 , Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:

> 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!");

llvm_unreachable? Also, how is this any different than what you had before?




More information about the cfe-commits mailing list