diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-08-30 01:43:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-30 01:43:54 +0200 |
| commit | 96e0bc7b6baa6199ea53f95d54e200556edcedad (patch) | |
| tree | 5188bf128dbba461f6ba8de637c5aca2ec470bbe /library/std/src/sys | |
| parent | 3b9ca2cb5208526275f79e41a87f7dde22cb1a8b (diff) | |
| parent | d931e974029a3475bd6712ca8d3bc9cb9dfe558f (diff) | |
| download | rust-96e0bc7b6baa6199ea53f95d54e200556edcedad.tar.gz rust-96e0bc7b6baa6199ea53f95d54e200556edcedad.zip | |
Rollup merge of #75990 - rylev:arm-fastfail, r=alexcrichton
Add __fastfail for Windows on arm/aarch64 Fixes #73215
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/windows/mod.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/windows/mod.rs index a0d5a7471d8..8178e6806b9 100644 --- a/library/std/src/sys/windows/mod.rs +++ b/library/std/src/sys/windows/mod.rs @@ -306,10 +306,20 @@ pub fn dur2timeout(dur: Duration) -> c::DWORD { /// that function for more information on `__fastfail` #[allow(unreachable_code)] pub fn abort_internal() -> ! { - #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + const FAST_FAIL_FATAL_APP_EXIT: usize = 7; unsafe { - llvm_asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT - crate::intrinsics::unreachable(); + cfg_if::cfg_if! { + if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { + asm!("int $$0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT); + crate::intrinsics::unreachable(); + } else if #[cfg(all(target_arch = "arm", target_feature = "thumb-mode"))] { + asm!(".inst 0xDEFB", in("r0") FAST_FAIL_FATAL_APP_EXIT); + crate::intrinsics::unreachable(); + } else if #[cfg(target_arch = "aarch64")] { + asm!("brk 0xF003", in("x0") FAST_FAIL_FATAL_APP_EXIT); + crate::intrinsics::unreachable(); + } + } } crate::intrinsics::abort(); } |
