[cfe-commits] r138615 - in /cfe/trunk: lib/CodeGen/CGException.cpp test/CodeGenCXX/exceptions.cpp

John McCall rjmccall at apple.com
Thu Aug 25 17:46:38 PDT 2011


Author: rjmccall
Date: Thu Aug 25 19:46:38 2011
New Revision: 138615

URL: http://llvm.org/viewvc/llvm-project?rev=138615&view=rev
Log:
The allocated exception slot does not alias anything;  should fix self-host.


Modified:
    cfe/trunk/lib/CodeGen/CGException.cpp
    cfe/trunk/test/CodeGenCXX/exceptions.cpp

Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=138615&r1=138614&r2=138615&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Thu Aug 25 19:46:38 2011
@@ -1034,7 +1034,8 @@
   // 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();

Modified: cfe/trunk/test/CodeGenCXX/exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions.cpp?rev=138615&r1=138614&r2=138615&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions.cpp Thu Aug 25 19:46:38 2011
@@ -390,3 +390,16 @@
     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();
+  }
+}





More information about the cfe-commits mailing list