Skip to content

Commit 4ad654b

Browse files
committed
Auto merge of #103009 - Dylan-DPC:rollup-9c2tng6, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #102765 (Suggest `==` to the first expr which has `ExprKind::Assign` kind) - #102854 (openbsd: don't reallocate a guard page on the stack.) - #102904 (Print return-position `impl Trait` in trait verbosely if `-Zverbose`) - #102947 (Sort elaborated existential predicates in `object_ty_for_trait`) - #102956 (Use `full_res` instead of `expect_full_res`) - #102999 (Delay `is_intrinsic` query until after we've determined the callee is a function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3a210b8 + 2c49b9a commit 4ad654b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

std/src/sys/unix/thread.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,16 @@ pub mod guard {
766766
const GUARD_PAGES: usize = 1;
767767
let guard = guardaddr..guardaddr + GUARD_PAGES * page_size;
768768
Some(guard)
769+
} else if cfg!(target_os = "openbsd") {
770+
// OpenBSD stack already includes a guard page, and stack is
771+
// immutable.
772+
//
773+
// We'll just note where we expect rlimit to start
774+
// faulting, so our handler can report "stack overflow", and
775+
// trust that the kernel's own stack guard will work.
776+
let stackptr = get_stack_start_aligned()?;
777+
let stackaddr = stackptr.addr();
778+
Some(stackaddr - page_size..stackaddr)
769779
} else {
770780
// Reallocate the last page of the stack.
771781
// This ensures SIGBUS will be raised on

0 commit comments

Comments
 (0)