Skip to content

asm!("asdflol" "nop"); compiles #21045

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

Closed
jonasschneider opened this issue Jan 12, 2015 · 1 comment · Fixed by #21144
Closed

asm!("asdflol" "nop"); compiles #21045

jonasschneider opened this issue Jan 12, 2015 · 1 comment · Fixed by #21144
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`)

Comments

@jonasschneider
Copy link

It looks like the implicit concatenation syntax (like in GCC) isn't supported by rustc or maybe LLVM.
In this case, the compiler should error. (Maybe this is just a problem with the asm! macro? If it is even a macro?)

Full example: on x86_64-linux run rustc hello.rs, hello.rs:

#![feature(asm)]
fn main() {
  unsafe { asm!("asdflol" "nop"); }
}

Expected behaviour: compiler error about invalid instruction "asdflolnop", or compiler error about "invalid asm concat syntax, please give a single string"
Actual behaviour: compiles to just a NOP (afaics)

@kmcallister kmcallister added the A-inline-assembly Area: Inline assembly (`asm!(…)`) label Jan 12, 2015
@nagisa
Copy link
Member

nagisa commented Jan 12, 2015

Intrested in taking this.

nagisa added a commit to nagisa/rust that referenced this issue Jan 14, 2015
alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants