Skip to content

Commit

Permalink
Explain why we need extra check in probestack.
Browse files Browse the repository at this point in the history
  • Loading branch information
qnighy committed May 28, 2018
1 parent 56293ad commit 1d15be6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/probestack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ pub unsafe extern fn __rust_probestack() {
// bytes pushed on the stack orginally with our return address. Using
// `8(%rsp)` simulates us testing the stack pointer in the caller's
// context.
// It's usually called when %rax >= 0x1000, but that's not always true.
// Dynamic stack allocation, which is needed to implement unsized
// rvalues, triggers stackprobe even if %rax < 0x1000.
// Thus we have to check %r11 first to avoid segfault.
cmp $$0x1000,%r11
jna 3f
2:
Expand Down

0 comments on commit 1d15be6

Please sign in to comment.