summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-08-26 00:46:38 +0000
committerJohn McCall <rjmccall@apple.com>2011-08-26 00:46:38 +0000
commit35e4f0cd0fc0e7f23b10c597f840639199f99eb0 (patch)
treefe4ba267073d7f1ffd1ba8484023e42738acb2d9
parent3b561ebd4478d7d62055bc5c9be3db10fa3c8c7f (diff)
downloadbcm5719-llvm-35e4f0cd0fc0e7f23b10c597f840639199f99eb0.tar.gz
bcm5719-llvm-35e4f0cd0fc0e7f23b10c597f840639199f99eb0.zip
The allocated exception slot does not alias anything; should fix self-host.
llvm-svn: 138615
-rw-r--r--clang/lib/CodeGen/CGException.cpp3
-rw-r--r--clang/test/CodeGenCXX/exceptions.cpp13
2 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 263ac63ccc5..0605f62b279 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -1034,7 +1034,8 @@ static void InitCatchParam(CodeGenFunction &CGF,
// Perform the copy construction.
CGF.EmitAggExpr(copyExpr, AggValueSlot::forAddr(ParamAddr, Qualifiers(),
AggValueSlot::IsNotDestructed,
- AggValueSlot::DoesNotNeedGCBarriers));
+ AggValueSlot::DoesNotNeedGCBarriers,
+ AggValueSlot::IsNotAliased));
// Leave the terminate scope.
CGF.EHStack.popTerminate();
diff --git a/clang/test/CodeGenCXX/exceptions.cpp b/clang/test/CodeGenCXX/exceptions.cpp
index 0ce9679a34b..4a32de024a3 100644
--- a/clang/test/CodeGenCXX/exceptions.cpp
+++ b/clang/test/CodeGenCXX/exceptions.cpp
@@ -390,3 +390,16 @@ namespace test7 {
return new B(A(), new B(A(), 0));
}
}
+
+// Just don't crash.
+namespace test8 {
+ struct A {
+ A(const A&);
+ ~A();
+ };
+
+ A makeA();
+ void test() {
+ throw makeA();
+ }
+}
OpenPOWER on IntegriCloud