Skip to content

Commit

Permalink
re-add old assert/comment, but disable for aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Jun 22, 2022
1 parent bfced46 commit cc53b85
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions runtime/src/append_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit cc53b85

Please sign in to comment.