Use a memcpy so that type based alias analysis sees the change.
[oota-llvm.git] / include / llvm / ADT / APInt.h
index 4d19bab13f43b1f66547830b07f19caa6392b359..f4e7e3c635656677c9dcd7465445f635d0d090d6 100644 (file)
@@ -665,7 +665,9 @@ public:
       delete[] pVal;
     }
 
-    VAL = that.VAL;
+    // Use memcpy so that type based alias analysis sees both VAL and pVal
+    // as modified.
+    memcpy(&VAL, &that.VAL, sizeof(uint64_t));
 
     // If 'this == &that', avoid zeroing our own bitwidth by storing to 'that'
     // first.