Skip to content

Missing label direction is not properly handled when using at&t syntax, with segfault on windows. #116498

Open
@TDecking

Description

@TDecking

I tried this code:

use std::arch::asm;

fn main() {
    println!("Hello, world!");

    unsafe {
        asm!(
            r#"
        jmp 9999
    9999:
            "#,
            options(nostack, att_syntax),
        );
    }
}

I expected to see this happen: An invalid operand for instruction error message, or something similar.

Instead, this happened: rustc segfaulted (windows). On Godbolt (Linux?), the code was accepted without error.
If att_syntax is removed, expected behaviour returns.

rustc --version --verbose:

rustc 1.73.0-nightly (03a119b0b 2023-08-07)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-inline-assemblyArea: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions