Skip to content

Commit

Permalink
fix a syntax bug in example assembly (#1511)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
oconnor663 authored Jul 26, 2022
1 parent f192719 commit cab2732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unsafe/asm.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ fn call_foo(arg: i32) -> i32 {
unsafe {
let result;
asm!(
"call *{}",
"call {}",
// Function pointer to call
in(reg) foo,
// 1st argument in rdi
Expand Down

0 comments on commit cab2732

Please sign in to comment.