about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2024-04-14 16:39:08 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2024-04-16 21:13:21 -0400
commit9ab6e36d8d1cad691a9078921a8ce07de5d4de02 (patch)
tree5500c32e9d789a6144e70dfa9812e4217468aaea
parent649e80184bf238760a2162c6f93090c4ed6abae8 (diff)
downloadrust-9ab6e36d8d1cad691a9078921a8ce07de5d4de02.tar.gz
rust-9ab6e36d8d1cad691a9078921a8ce07de5d4de02.zip
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.
-rw-r--r--tests/run-make/static-pie/test-aslr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/run-make/static-pie/test-aslr.rs b/tests/run-make/static-pie/test-aslr.rs
index 96b17af46df..8d8e7586323 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);