Skip to content

Commit 13e351f

Browse files
nia-eoli-obk
andauthored
Update src/shims/trace/parent.rs
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
1 parent 079ce3d commit 13e351f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/shims/trace/parent.rs

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

583583
// Check if we also own the next page, and if so unprotect it in case
584584
// the access spans the page boundary.
585-
if ch_pages.contains(&page_addr.strict_add(page_size)) {
586-
ptrace::write(pid, (&raw const PAGE_COUNT).cast_mut().cast(), 2).unwrap();
585+
let flag = if ch_pages.contains(&page_addr.strict_add(page_size)) {
586+
2
587587
} else {
588-
ptrace::write(pid, (&raw const PAGE_COUNT).cast_mut().cast(), 1).unwrap();
589-
}
588+
1
589+
};
590+
ptrace::write(pid, (&raw const PAGE_COUNT).cast_mut().cast(), flag).unwrap();
590591

591592
ptrace::setregs(pid, new_regs).unwrap();
592593

0 commit comments

Comments
 (0)