Skip to content

Commit

Permalink
Fix inline asm $ usage in panic_abort
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Oct 6, 2023
1 parent b6dd297 commit abc6694
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions patches/0028-stdlib-Fix-inline-asm-usage-in-panic_abort.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 92cf0e9491bfe120949fe2aa38701f6b3a599bde Mon Sep 17 00:00:00 2001
From: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date: Fri, 6 Oct 2023 19:09:56 +0000
Subject: [PATCH] Fix inline asm $ usage in panic_abort and std

---
library/panic_abort/src/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/panic_abort/src/lib.rs b/library/panic_abort/src/lib.rs
index 6e097e2..e2e2be9 100644
--- a/library/panic_abort/src/lib.rs
+++ b/library/panic_abort/src/lib.rs
@@ -70,7 +70,7 @@ pub unsafe fn __rust_start_panic(_payload: &mut dyn PanicPayload) -> u32 {
const FAST_FAIL_FATAL_APP_EXIT: usize = 7;
cfg_if::cfg_if! {
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
- core::arch::asm!("int $$0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT);
+ core::arch::asm!("int 0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT);
} else if #[cfg(all(target_arch = "arm", target_feature = "thumb-mode"))] {
core::arch::asm!(".inst 0xDEFB", in("r0") FAST_FAIL_FATAL_APP_EXIT);
} else if #[cfg(target_arch = "aarch64")] {
diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/windows/mod.rs
index b609ad2..4437be5 100644
--- a/library/std/src/sys/windows/mod.rs
+++ b/library/std/src/sys/windows/mod.rs
@@ -322,7 +322,7 @@ pub fn abort_internal() -> ! {
unsafe {
cfg_if::cfg_if! {
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
- core::arch::asm!("int $$0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT);
+ core::arch::asm!("int $0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT);
crate::intrinsics::unreachable();
} else if #[cfg(all(target_arch = "arm", target_feature = "thumb-mode"))] {
core::arch::asm!(".inst 0xDEFB", in("r0") FAST_FAIL_FATAL_APP_EXIT);
--
2.34.1

0 comments on commit abc6694

Please sign in to comment.