summaryrefslogtreecommitdiff
path: root/test/scudo/memalign.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:40 +0000
commit462d72ec21756f5ca1002f128f014d36a845f3d2 (patch)
treeb3d61e87f3a1b79e57d9639497994df822687bf0 /test/scudo/memalign.cpp
parent1992b790c2c12b7850bdf86662b67302052ec2fe (diff)
Diffstat (limited to 'test/scudo/memalign.cpp')
-rw-r--r--test/scudo/memalign.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/scudo/memalign.cpp b/test/scudo/memalign.cpp
index 856128f2489ff..82c54af8b0e49 100644
--- a/test/scudo/memalign.cpp
+++ b/test/scudo/memalign.cpp
@@ -65,15 +65,15 @@ int main(int argc, char **argv)
// Size is not a multiple of alignment.
p = aligned_alloc(alignment, size >> 1);
assert(!p);
- p = (void *)0x42UL;
+ void *p_unchanged = (void *)0x42UL;
+ p = p_unchanged;
// Alignment is not a power of 2.
err = posix_memalign(&p, 3, size);
- assert(!p);
+ assert(p == p_unchanged);
assert(err == EINVAL);
- p = (void *)0x42UL;
// Alignment is a power of 2, but not a multiple of size(void *).
err = posix_memalign(&p, 2, size);
- assert(!p);
+ assert(p == p_unchanged);
assert(err == EINVAL);
}
return 0;