diff options
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 5 | ||||
-rw-r--r-- | test/CodeGenObjC/debug-info-crash.m | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index a5d990a4ed..5768e5b4db 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1517,12 +1517,13 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag, // Create the descriptor for the variable. llvm::DIVariable D = - DebugFactory.CreateComplexVariable(Tag, llvm::DIDescriptor(RegionStack.back()), + DebugFactory.CreateComplexVariable(Tag, + llvm::DIDescriptor(RegionStack.back()), Decl->getName(), Unit, Line, Ty, addr); // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = - DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertPoint()); + DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock()); llvm::DIScope DS(RegionStack.back()); llvm::DILocation DO(NULL); diff --git a/test/CodeGenObjC/debug-info-crash.m b/test/CodeGenObjC/debug-info-crash.m new file mode 100644 index 0000000000..011935c767 --- /dev/null +++ b/test/CodeGenObjC/debug-info-crash.m @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fblocks -g -S %s -o - + +// rdar://7556129 +@implementation test +- (void)wait { + ^{}; +} +@end + |