fix assumption that ScalarPair Box is always a fat pointer
This commit is contained in:
parent
393fdc1048
commit
ae32f43c50
2 changed files with 7 additions and 1 deletions
|
@ -330,7 +330,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx> {
|
|||
ty::Ref(..) | ty::RawPtr(_) => {
|
||||
return self.field(cx, index).llvm_type(cx);
|
||||
}
|
||||
ty::Adt(def, _) if def.is_box() => {
|
||||
ty::Adt(def, substs) if def.is_box() && cx.layout_of(substs.type_at(1)).is_zst() => {
|
||||
let ptr_ty = cx.tcx.mk_mut_ptr(self.ty.boxed_ty());
|
||||
return cx.layout_of(ptr_ty).scalar_pair_element_llvm_type(cx, index, immediate);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue