From 9ab6e36d8d1cad691a9078921a8ce07de5d4de02 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sun, 14 Apr 2024 16:39:08 -0400 Subject: [PATCH] Fix broken test Testing for ASLR by casting &ZST to *const _ is not useful, there's no guarantee that &ZST produces an ASLR'd pointer. --- tests/run-make/static-pie/test-aslr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-make/static-pie/test-aslr.rs b/tests/run-make/static-pie/test-aslr.rs index 96b17af46dfe9..8d8e7586323a9 100644 --- a/tests/run-make/static-pie/test-aslr.rs +++ b/tests/run-make/static-pie/test-aslr.rs @@ -17,7 +17,7 @@ fn main() { let arg0 = args.next().unwrap(); match args.next() { Some(s) if s.eq("--report") => { - println!("main = {:#?}", &main as *const _); + println!("main = {:#?}", main as fn() as usize); } Some(s) if s.eq("--test-no-aslr") => { let cnt = run_self(&arg0);