Skip to content

Commit cab2732

Browse files
authored
fix a syntax bug in example assembly (rust-lang#1511)
The `call *` syntax is used in AT&T syntax but not in Intel syntax. (Source: https://stackoverflow.com/a/19088205/823869.) To make this example compile, I think we need to remove the `*`. Playground example broken: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=585dff3c1b43c7a493082ea66c7cdaad Playground example working: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c4517f46219140ba4345a1656fe7e106
1 parent f192719 commit cab2732

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unsafe/asm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ fn call_foo(arg: i32) -> i32 {
311311
unsafe {
312312
let result;
313313
asm!(
314-
"call *{}",
314+
"call {}",
315315
// Function pointer to call
316316
in(reg) foo,
317317
// 1st argument in rdi

0 commit comments

Comments
 (0)