]> git.lizzy.rs Git - rust.git/commitdiff
de-obfuscate ptr comparison a bit
authorRalf Jung <post@ralfj.de>
Sun, 23 Jun 2019 18:30:33 +0000 (20:30 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 23 Jun 2019 18:30:33 +0000 (20:30 +0200)
src/operator.rs

index b735cbcba4eceb07d9ef5476f25e309af4085f25..5d1f33a5709386a0d12227e3a85a6ff207d70834 100644 (file)
@@ -193,8 +193,8 @@ fn ptr_eq(
                     // on read hardware this can easily happen. Thus for comparisons we require
                     // both pointers to be live.
                     if self.pointer_inbounds(left).is_ok() && self.pointer_inbounds(right).is_ok() {
-                        // Two in-bounds pointers, we can compare across allocations.
-                        left == right
+                        // Two in-bounds pointers in different allocatons are different.
+                        false
                     } else {
                         return err!(InvalidPointerMath);
                     }