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); }