rustc_codegen_ssa: use project_index
, not project_field
, for array literals.
This commit is contained in:
parent
66c83ffca1
commit
900309ec8a
@ -125,7 +125,12 @@ pub fn codegen_rvalue(
|
||||
// Do not generate stores and GEPis for zero-sized fields.
|
||||
if !op.layout.is_zst() {
|
||||
let field_index = active_field_index.unwrap_or(i);
|
||||
let field = dest.project_field(&mut bx, field_index);
|
||||
let field = if let mir::AggregateKind::Array(_) = **kind {
|
||||
let llindex = bx.cx().const_usize(field_index as u64);
|
||||
dest.project_index(&mut bx, llindex)
|
||||
} else {
|
||||
dest.project_field(&mut bx, field_index)
|
||||
};
|
||||
op.val.store(&mut bx, field);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user