]> granicus.if.org Git - clang/commitdiff
fix rdar://7556129 a crash in blocks debug info codegen.
authorChris Lattner <sabre@nondot.org>
Mon, 25 Jan 2010 03:34:56 +0000 (03:34 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 25 Jan 2010 03:34:56 +0000 (03:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94402 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenObjC/debug-info-crash.m [new file with mode: 0644]

index a5d990a4ed7e51b78096f7c443b93ae253c1e003..5768e5b4db5c4741769362d3b41ebcaa91248e27 100644 (file)
@@ -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 (file)
index 0000000..011935c
--- /dev/null
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -fblocks -g -S %s -o -
+
+// rdar://7556129
+@implementation test
+- (void)wait {
+  ^{};
+}
+@end
+