From f29479ecc8110334d638a2e7fda956642f06b1b7 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 3 Jun 2016 23:26:30 +0000 Subject: [PATCH] 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 --- lib/CodeGen/CGBlocks.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)) -- 2.40.0