Skip to content

Commit 02df2b1

Browse files
nia-eoli-obk
andcommitted
Update src/shims/trace/parent.rs
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
1 parent d59518d commit 02df2b1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/tools/miri/src/shims/trace/parent.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,11 +566,12 @@ fn handle_segfault(
566566

567567
// Check if we also own the next page, and if so unprotect it in case
568568
// the access spans the page boundary.
569-
if ch_pages.contains(&page_addr.strict_add(page_size)) {
570-
ptrace::write(pid, (&raw const PAGE_COUNT).cast_mut().cast(), 2).unwrap();
569+
let flag = if ch_pages.contains(&page_addr.strict_add(page_size)) {
570+
2
571571
} else {
572-
ptrace::write(pid, (&raw const PAGE_COUNT).cast_mut().cast(), 1).unwrap();
573-
}
572+
1
573+
};
574+
ptrace::write(pid, (&raw const PAGE_COUNT).cast_mut().cast(), flag).unwrap();
574575

575576
ptrace::setregs(pid, new_regs).unwrap();
576577

0 commit comments

Comments
 (0)