mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-04 17:22:19 +00:00
When adding `OperandValue::Uninit` to skip stores for entirely-uninit constants, we missed the `PassMode::Direct | PassMode::Pair` branch of `codegen_return_terminator`, which called `immediate_or_packed_pair` unconditionally. A function directly returning an all-uninit value (e.g. `MaybeUninit::uninit()`) would hit that branch and ICE in `OperandRef::immediate`, as reported against tokio and reduced by tmiasko.
14 lines
287 B
Rust
14 lines
287 B
Rust
// Regression test for https://github.com/rust-lang/rust/issues/159815
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
use std::mem::MaybeUninit;
|
|
|
|
// CHECK-LABEL: @f
|
|
#[no_mangle]
|
|
pub fn f() -> MaybeUninit<*const ()> {
|
|
// CHECK: start:
|
|
// CHECK-NEXT: ret ptr undef
|
|
const { MaybeUninit::uninit() }
|
|
}
|