From: Saleem Abdulrasool Date: Fri, 3 Jun 2016 23:26:30 +0000 (+0000) Subject: CodeGen: correct assertion X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f29479ecc8110334d638a2e7fda956642f06b1b7;p=clang CodeGen: correct assertion The assertion added earlier was overly strict. We need to strip the pointer casts (as when constructing the GV). Correct the types (Function or Variable). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271750 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 3105046cff..5a41f361d9 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -2294,8 +2294,9 @@ static void configureBlocksRuntimeObject(CodeGenModule &CGM, TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl(); DeclContext *DC = TranslationUnitDecl::castToDeclContext(TUDecl); - assert((isa(C) || isa(C)) && - "expected Function or GlobalValue"); + assert((isa(C->stripPointerCasts()) || + isa(C->stripPointerCasts())) && + "expected Function or GlobalVariable"); const NamedDecl *ND = nullptr; for (const auto &Result : DC->lookup(&II))