Closed
Description
Code
#![feature(asm)]
#[inline(always)]
fn f() {
unsafe {
asm!("test: nop");
}
}
fn main() {
f();
f();
}
Meta
rustc 1.46.0-nightly (346aec9b0 2020-07-11)
binary: rustc
commit-hash: 346aec9b02f3c74f3fce97fd6bda24709d220e49
commit-date: 2020-07-11
host: x86_64-pc-windows-msvc
release: 1.46.0-nightly
LLVM version: 10.0
Error output
error: invalid symbol redefinition
--> .\crash.rs:6:15
|
6 | asm!("test: nop");
| ^
|
note: instantiated into assembly here
--> <inline asm>:2:2
|
2 | test: nop
| ^
[crash due to null dereference]
Details
This bug only happens when compiling for Windows target with debug information. Command to reproduce crash:
rustc crash.rs --target x86_64-pc-windows-msvc -g
It was identified by eddyb that crash happens in LLVM function WinCOFFObjectWriter::assignFileOffsets.
Metadata
Metadata
Assignees
Labels
Area: Inline assembly (`asm!(…)`)Category: This is a bug.`#![feature(asm)]` (not `llvm_asm`)Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Relevant to the compiler team, which will review and decide on the PR/issue.