Auto merge of #94873 - DrMeepster:box_alloc_ice3, r=oli-obk
Fix ICE when using Box<T, A>, again Sequel to #94043, fixes #94835.
This commit is contained in:
commit
ed2a69c4a9
2 changed files with 14 additions and 1 deletions
|
@ -126,7 +126,14 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
|
|||
.ty;
|
||||
let (llptr, llextra) = match self.val {
|
||||
OperandValue::Immediate(llptr) => (llptr, None),
|
||||
OperandValue::Pair(llptr, llextra) => (llptr, Some(llextra)),
|
||||
OperandValue::Pair(llptr, llextra) => {
|
||||
// if the box's allocator isn't a ZST, then "llextra" is actually the allocator
|
||||
if self.layout.ty.is_box() && !self.layout.field(cx, 1).is_zst() {
|
||||
(llptr, None)
|
||||
} else {
|
||||
(llptr, Some(llextra))
|
||||
}
|
||||
}
|
||||
OperandValue::Ref(..) => bug!("Deref of by-Ref operand {:?}", self),
|
||||
};
|
||||
let layout = cx.layout_of(projected_ty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue