Skip to content

Commit b8a0ee7

Browse files
adamgreigjonas-schievink
authored andcommitted
Swap infinite loops for unreachable_unchecked()
1 parent ab699de commit b8a0ee7

9 files changed

+2
-3
lines changed

asm.s

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ __sev:
120120
.thumb_func
121121
__udf:
122122
udf
123-
bx lr
124123

125124
.section .text.__wfe
126125
.global __wfe

bin/thumbv6m-none-eabi.a

-4 Bytes
Binary file not shown.

bin/thumbv7em-none-eabi.a

-4 Bytes
Binary file not shown.

bin/thumbv7em-none-eabihf.a

-4 Bytes
Binary file not shown.

bin/thumbv7m-none-eabi.a

-4 Bytes
Binary file not shown.

bin/thumbv8m.base-none-eabi.a

-4 Bytes
Binary file not shown.

bin/thumbv8m.main-none-eabi.a

-4 Bytes
Binary file not shown.

bin/thumbv8m.main-none-eabihf.a

-4 Bytes
Binary file not shown.

src/asm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn udf() -> ! {
9191
#[cfg(all(cortex_m, feature = "inline-asm"))]
9292
() => unsafe {
9393
asm!("udf" :::: "volatile");
94-
loop { continue }
94+
core::hint::unreachable_unchecked();
9595
},
9696

9797
#[cfg(all(cortex_m, not(feature = "inline-asm")))]
@@ -102,7 +102,7 @@ pub fn udf() -> ! {
102102

103103
__udf();
104104

105-
loop { continue }
105+
core::hint::unreachable_unchecked();
106106
},
107107

108108
#[cfg(not(cortex_m))]

0 commit comments

Comments
 (0)