From 029a29407acd30454fb41f340a8d108a47bef349 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 5 Jul 2019 23:51:11 +0200 Subject: [PATCH] dangling-ptr-to-int should work now; move to noseed --- tests/{run-pass => run-pass-noseed}/malloc.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename tests/{run-pass => run-pass-noseed}/malloc.rs (84%) diff --git a/tests/run-pass/malloc.rs b/tests/run-pass-noseed/malloc.rs similarity index 84% rename from tests/run-pass/malloc.rs rename to tests/run-pass-noseed/malloc.rs index a50b3f3606..bf51baacd3 100644 --- a/tests/run-pass/malloc.rs +++ b/tests/run-pass-noseed/malloc.rs @@ -11,10 +11,8 @@ fn main() { // Test that small allocations sometimes *are* not very aligned. let saw_unaligned = (0..64).any(|_| unsafe { let p = libc::malloc(3); - let addr = p as usize; - let unaligned = addr % 4 != 0; // test that this is not 4-aligned - libc::free(p); // FIXME have to free *after* test; should allow ptr-to-int of dangling ptr. - unaligned + libc::free(p); + (p as usize) % 4 != 0 // find any that this is *not* 4-aligned }); assert!(saw_unaligned);