summaryrefslogtreecommitdiffstats
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
commit83b0dd16c38975a04b95018ee74bbcdb4f21c27b (patch)
treee4c0d72ad353ebd7aff3793f600023de89fe3401
parentbf78478d35b51cc924afd74f650ac8ba99f2ba78 (diff)
downloadbcm5719-llvm-83b0dd16c38975a04b95018ee74bbcdb4f21c27b.tar.gz
bcm5719-llvm-83b0dd16c38975a04b95018ee74bbcdb4f21c27b.zip
fix rdar://7556129 a crash in blocks debug info codegen.
llvm-svn: 94402
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp5
-rw-r--r--clang/test/CodeGenObjC/debug-info-crash.m9
2 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index a5d990a4ed7..5768e5b4db5 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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/clang/test/CodeGenObjC/debug-info-crash.m b/clang/test/CodeGenObjC/debug-info-crash.m
new file mode 100644
index 00000000000..011935c7674
--- /dev/null
+++ b/clang/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
+
OpenPOWER on IntegriCloud