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.
jmp
1 parent b6091ab commit c9bff74Copy full SHA for c9bff74
src/x86_64.rs
@@ -30,12 +30,9 @@ pub unsafe fn ___chkstk_ms() {
30
#[naked]
31
#[cfg_attr(not(test), no_mangle)]
32
pub unsafe fn __alloca() {
33
- asm!("mov %rcx,%rax // x64 _alloca is a normal function with parameter in rcx");
34
- // The original behavior had __alloca fall through to ___chkstk here, but
35
- // I don't believe that this behavior is guaranteed, and a program that uses
36
- // only __alloca could have ___chkstk removed by --gc-sections. Call
37
- // ___chkstk here to guarantee that neither of those happen.
38
- ___chkstk();
+ asm!("mov %rcx,%rax // x64 _alloca is a normal function with parameter in rcx
+ jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable");
+ intrinsics::unreachable();
39
}
40
41
#[cfg(windows)]
0 commit comments