]> granicus.if.org Git - clang/commitdiff
The allocated exception slot does not alias anything; should fix self-host.
authorJohn McCall <rjmccall@apple.com>
Fri, 26 Aug 2011 00:46:38 +0000 (00:46 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 26 Aug 2011 00:46:38 +0000 (00:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138615 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGException.cpp
test/CodeGenCXX/exceptions.cpp

index 263ac63ccc5a910512c205df79f04e421c199d9b..0605f62b2790d63c272ca46c0b7312feb105a007 100644 (file)
@@ -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();
index 0ce9679a34beb3e2a2cd3a7dcebcecd7e1d083d9..4a32de024a347199889a59202f80a86834036d0f 100644 (file)
@@ -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();
+  }
+}