From cc53b859f3d2151235e91b392fde749e7ca57f42 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Wed, 22 Jun 2022 09:55:32 -0400 Subject: [PATCH] re-add old assert/comment, but disable for aarch64 --- runtime/src/append_vec.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/runtime/src/append_vec.rs b/runtime/src/append_vec.rs index 03d417c913cd3f..ecfa8046e206a0 100644 --- a/runtime/src/append_vec.rs +++ b/runtime/src/append_vec.rs @@ -905,10 +905,16 @@ pub mod tests { // we can observe crafted value by ref { let executable_bool: &bool = &account.account_meta.executable; - // Depending on use, *executable_bool can be truthy or falsy due to direct memory manipulation. - // Behavior is dependent on compiler. - // assert! thinks !*executable_bool is true, for all compilers + // Depending on use, *executable_bool can be truthy or falsy due to direct memory manipulation + // assert_eq! thinks *executable_bool is equal to false but the if condition thinks it's not, contradictorily. assert!(!*executable_bool); + #[cfg(not(target_arch = "aarch64"))] + { + const FALSE: bool = false; // keep clippy happy + if *executable_bool == FALSE { + panic!("This didn't occur if this test passed."); + } + } assert_eq!(*account.ref_executable_byte(), crafted_executable); }