Skip to content

Commit f5d2ffd

Browse files
authored
Rollup merge of #75224 - Aaron1011:fix/function-arguments-naked, r=Amanieu
Don't call a function in function-arguments-naked.rs Fixes #75096 It's U.B. to use anything other than inline assmebling in a naked function. Fortunately, the `#break` directive works fine without anything in the function body.
2 parents f3a9de9 + c34c77c commit f5d2ffd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/test/debuginfo/function-arguments-naked.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// We have to ignore android because of this issue:
44
// https://github.com/rust-lang/rust/issues/74847
55
// ignore-android
6+
//
7+
// We need to use inline assembly, so just use one platform
8+
// only-x86_64
69

710
// compile-flags:-g
811

@@ -24,6 +27,7 @@
2427
// lldb-command:continue
2528

2629

30+
#![feature(asm)]
2731
#![feature(naked_functions)]
2832
#![feature(omit_gdb_pretty_printer_section)]
2933
#![omit_gdb_pretty_printer_section]
@@ -33,8 +37,6 @@ fn main() {
3337
}
3438

3539
#[naked]
36-
fn naked(x: usize, y: usize) {
37-
zzz(); // #break
40+
extern "C" fn naked(x: usize, y: usize) {
41+
unsafe { asm!("ret"); } // #break
3842
}
39-
40-
fn zzz() { () }

0 commit comments

Comments
 (0)