Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The first line of assembly is missing #171

Open
RustyYato opened this issue Mar 12, 2020 · 0 comments
Open

The first line of assembly is missing #171

RustyYato opened this issue Mar 12, 2020 · 0 comments

Comments

@RustyYato
Copy link

RustyYato commented Mar 12, 2020

pub fn inc(x: usize) -> usize {
    x + 1
}

I tried running cargo asm $crate_name::inc, and got

brand::inc:
 ret

Notice how the first line of assembly is missing (the add instruction)

Moreover, when I add a spin_loop_hint

pub fn inc(x: usize) -> usize {
    std::sync::atomic::spin_loop_hint();
    x + 1
}
brand::inc:
 lea     rax, [rcx, +, 1]
 ret

Notice how the first line of assembly is missing (the pause instruction).
So, looks like it just isn't printing out the first line correctly, or the first line gets overwritten by the function name.

I'm running on windows (rust nightly-x86_64-pc-windows-msvc) with version 0.1.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant