check the the right field
This commit is contained in:
parent
e9f08e709d
commit
ece64ed3f5
@ -455,7 +455,7 @@ pub fn codegen_place(
|
||||
cg_base = match elem.clone() {
|
||||
mir::ProjectionElem::Deref => {
|
||||
// a box with a non-zst allocator should not be directly dereferenced
|
||||
if cg_base.layout.ty.is_box() && !cg_base.layout.field(cx, 0).is_zst() {
|
||||
if cg_base.layout.ty.is_box() && !cg_base.layout.field(cx, 1).is_zst() {
|
||||
let ptr = cg_base.project_field(bx, 0).project_field(bx, 0);
|
||||
|
||||
bx.load_operand(ptr).deref(bx.cx())
|
||||
|
Loading…
Reference in New Issue
Block a user