mirror of
https://github.com/facebookexperimental/reverie.git
synced 2024-11-24 12:17:50 +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;
|
use reverie_ptrace::testing::test_fn;
|
||||||
let (output, _) = test_fn::<NoopTool, _>(|| {
|
let (output, _) = test_fn::<NoopTool, _>(|| {
|
||||||
unsafe {
|
unsafe {
|
||||||
let invalid_ptr = 0x5u64 as *mut u64;
|
let invalid_ptr = 0x8u64 as *mut u64;
|
||||||
invalid_ptr.write(0xdeadbeefu64);
|
invalid_ptr.write_volatile(0xdeadbeefu64);
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -246,8 +246,8 @@ fn i_should_segfault_2() {
|
||||||
use reverie_ptrace::testing::test_fn;
|
use reverie_ptrace::testing::test_fn;
|
||||||
|
|
||||||
pub fn do_segfault() {
|
pub fn do_segfault() {
|
||||||
let invalid_ptr = 0x1234 as *const usize;
|
let invalid_ptr = 0x8u64 as *const usize;
|
||||||
let result = unsafe { invalid_ptr.read() };
|
let result = unsafe { invalid_ptr.read_volatile() };
|
||||||
// Print so the above doesn't get optimized out. We will never get here
|
// Print so the above doesn't get optimized out. We will never get here
|
||||||
// because the above segfaults.
|
// because the above segfaults.
|
||||||
println!("{}", result);
|
println!("{}", result);
|
||||||
|
|
Loading…
Reference in a new issue