From 3fb04c6aeca7151814a0eb7fcc469dd44e475957 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Sun, 30 Oct 2016 22:27:55 +0300 Subject: [PATCH] tests: fix invalid pointer checks in getcpu test * test/getcpu.c (main): Replace magic numbers deemed invalid pointers with addresses after memory returned by tail_alloc. --- tests/getcpu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/getcpu.c b/tests/getcpu.c index baef1bb4..661840c5 100644 --- a/tests/getcpu.c +++ b/tests/getcpu.c @@ -39,12 +39,12 @@ int main(void) { - static const unsigned *bogus_cpu = - (unsigned *) (unsigned long) 0xfffffeedfffffaceULL; - static const unsigned *bogus_node = - (unsigned *) (unsigned long) 0xfffffca7ffffc0deULL; - static const unsigned *bogus_tcache = - (unsigned *) (unsigned long) 0xffffda7affffdeadULL; + unsigned *bogus_cpu = + (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + unsigned *bogus_node = + (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + unsigned *bogus_tcache = + (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; long res; unsigned *cpu = tail_alloc(sizeof(*cpu)); -- 2.40.0