aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-25 03:34:56 +0000
committerChris Lattner <sabre@nondot.org>2010-01-25 03:34:56 +0000
commit165714e026f96e6014d190f166feecc0b1fb80f8 (patch)
treea331409ad097628f06eab7cf8055c20a61257716
parent14b1a363fbc42f3bac7e6a08a5a7bc425d3537bf (diff)
fix rdar://7556129 a crash in blocks debug info codegen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94402 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp5
-rw-r--r--test/CodeGenObjC/debug-info-crash.m9
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
+