Avoid CValue::const_val in a couple of places
This commit is contained in:
parent
0e50c9e4f3
commit
a5f11c7aeb
@ -767,7 +767,10 @@ fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
|
|||||||
NullOp::SizeOf => layout.size.bytes(),
|
NullOp::SizeOf => layout.size.bytes(),
|
||||||
NullOp::AlignOf => layout.align.abi.bytes(),
|
NullOp::AlignOf => layout.align.abi.bytes(),
|
||||||
};
|
};
|
||||||
let val = CValue::const_val(fx, fx.layout_of(fx.tcx.types.usize), val.into());
|
let val = CValue::by_val(
|
||||||
|
fx.bcx.ins().iconst(fx.pointer_type, i64::try_from(val).unwrap()),
|
||||||
|
fx.layout_of(fx.tcx.types.usize),
|
||||||
|
);
|
||||||
lval.write_cvalue(fx, val);
|
lval.write_cvalue(fx, val);
|
||||||
}
|
}
|
||||||
Rvalue::Aggregate(ref kind, ref operands) => {
|
Rvalue::Aggregate(ref kind, ref operands) => {
|
||||||
|
@ -1103,8 +1103,8 @@ fn codegen_regular_intrinsic_call<'tcx>(
|
|||||||
|
|
||||||
fx.bcx.ins().call_indirect(f_sig, f, &[data]);
|
fx.bcx.ins().call_indirect(f_sig, f, &[data]);
|
||||||
|
|
||||||
let layout = ret.layout();
|
let layout = fx.layout_of(fx.tcx.types.i32);
|
||||||
let ret_val = CValue::const_val(fx, layout, ty::ScalarInt::null(layout.size));
|
let ret_val = CValue::by_val(fx.bcx.ins().iconst(types::I32, 0), layout);
|
||||||
ret.write_cvalue(fx, ret_val);
|
ret.write_cvalue(fx, ret_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user