mirror of
https://github.com/facebookexperimental/reverie.git
synced 2024-11-24 04:09:38 +00:00
Fix broken test after toolchain update
Summary: These tests did unaligned reads/writes, which can produce a `SIGABRT` instead of a `SIGSEGV`. Simply align the reads/writes to 8 bytes to fix the tests. Reviewed By: JakobDegen, dtolnay Differential Revision: D53597637 fbshipit-source-id: e2ede420b6249223569af6d89d43a47438967ced
This commit is contained in:
parent
06f05e10f4
commit
17e8f64e94
1 changed files with 4 additions and 4 deletions
|
@ -231,8 +231,8 @@ fn i_should_segfault() {
|
|||
use reverie_ptrace::testing::test_fn;
|
||||
let (output, _) = test_fn::<NoopTool, _>(|| {
|
||||
unsafe {
|
||||
let invalid_ptr = 0x5u64 as *mut u64;
|
||||
invalid_ptr.write(0xdeadbeefu64);
|
||||
let invalid_ptr = 0x8u64 as *mut u64;
|
||||
invalid_ptr.write_volatile(0xdeadbeefu64);
|
||||
};
|
||||
})
|
||||
.unwrap();
|
||||
|
@ -246,8 +246,8 @@ fn i_should_segfault_2() {
|
|||
use reverie_ptrace::testing::test_fn;
|
||||
|
||||
pub fn do_segfault() {
|
||||
let invalid_ptr = 0x1234 as *const usize;
|
||||
let result = unsafe { invalid_ptr.read() };
|
||||
let invalid_ptr = 0x8u64 as *const usize;
|
||||
let result = unsafe { invalid_ptr.read_volatile() };
|
||||
// Print so the above doesn't get optimized out. We will never get here
|
||||
// because the above segfaults.
|
||||
println!("{}", result);
|
||||
|
|
Loading…
Reference in a new issue