1
Fork 0

Fix inttoptr

This commit is contained in:
bjorn3 2022-02-26 09:41:37 +01:00
parent a7c1c47c83
commit 3e35fab71e

View file

@ -906,12 +906,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
} }
fn inttoptr(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> { fn inttoptr(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {
assert_eq!( let usize_value = self.intcast(value, self.cx.type_isize(), false);
value.get_type(), self.cx.const_bitcast(usize_value, dest_ty)
self.cx.type_isize(),
"cg_ssa currently only calls this function with an isize argument",
);
self.cx.const_bitcast(value, dest_ty)
} }
fn bitcast(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> { fn bitcast(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {