diff options
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 3105046cff5..5a41f361d9a 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/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<llvm::Function>(C) || isa<llvm::GlobalValue>(C)) && - "expected Function or GlobalValue"); + assert((isa<llvm::Function>(C->stripPointerCasts()) || + isa<llvm::GlobalVariable>(C->stripPointerCasts())) && + "expected Function or GlobalVariable"); const NamedDecl *ND = nullptr; for (const auto &Result : DC->lookup(&II)) |