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.
1 parent b089d71 commit 57152dcCopy full SHA for 57152dc
c-scape/src/jmp.rs
@@ -76,6 +76,9 @@ unsafe extern "C" fn setjmp(env: jmp_buf) -> c_int {
76
#[cfg(all(target_arch = "riscv64", not(target_feature = "soft-float")))]
77
{
78
naked_asm!(
79
+ // arch option manipulation needed due to LLVM/Rust bug, see rust-lang/rust#80608
80
+ ".option push",
81
+ ".option arch, +d",
82
// Save all the callee-saved registers, the incoming stack pointer
83
// value, and the incoming return address into the `jmp_buf`.
84
"sd s0, 0(a0)",
@@ -108,7 +111,9 @@ unsafe extern "C" fn setjmp(env: jmp_buf) -> c_int {
108
111
// Return 0.
109
112
"li a0, 0",
110
113
// Return to the caller normally.
- "ret"
114
+ "ret",
115
116
+ ".option pop"
117
)
118
}
119
0 commit comments