Closed
Description
#![feature(abi_x86_interrupt)]
#[repr(C)]
pub struct Context<'a> {
inner: &'a mut u8,
}
extern "x86-interrupt" fn isr(_: Context) { }
pub fn main() {
println!("oops: {:x}", isr as usize);
}
yields
> rustc crash.rs
Segmentation fault (core dumped)
Interestingly, it seems like #[repr(C)]
is load-bearing? No crash without a repr
on the argument type. Also no crash if the argument is zero-sized (even with #[repr(C)]
).
Metadata
Metadata
Assignees
Labels
Area: Code generationCategory: This is a bug.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Target: x86 processors, 32 bit (like i686-*) (IA-32)Relevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
iximeow commentedon Dec 28, 2019
It seems like this might be related to #63018, where this is also resulting in nonsense IR to LLVM?
workingjubilee commentedon Aug 6, 2022
This no longer appears to crash?
iximeow commentedon Oct 22, 2022
yup, looks like this was fixed in the last few years:
neat!