We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
catch_longjmp
lr
fp
longjmp
1 parent 9ea91be commit 646ec2cCopy full SHA for 646ec2c
src/r3_port_std/src/threading_unix.rs
@@ -381,22 +381,20 @@ fn catch_longjmp<F: FnOnce(JmpBuf)>(cb: F) {
381
() => {
382
asm!(
383
"
384
- # push context
+ # push context. jump to 0 if longjmp is called
385
adr x2, 0f
386
str x2, [sp, #-32]!
387
stp x29, x30, [sp, #16]
388
389
# do f(ctx, jmp_buf)
390
- # [rdi = ctx, rsp = jmp_buf]
+ # [x0 = ctx, x1 = jmp_buf]
391
mov x1, sp
392
blr {f}
393
394
- b 1f
395
0:
396
- # longjmp called. restore context
+ # restore lr and fp
397
ldp x29, x30, [sp, #16]
398
399
- 1:
400
# discard context
401
add sp, sp, #32
402
",
0 commit comments