Skip to content

Commit 3e35fab

Browse files
committed
Fix inttoptr
1 parent a7c1c47 commit 3e35fab

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/builder.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -906,12 +906,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
906906
}
907907

908908
fn inttoptr(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {
909-
assert_eq!(
910-
value.get_type(),
911-
self.cx.type_isize(),
912-
"cg_ssa currently only calls this function with an isize argument",
913-
);
914-
self.cx.const_bitcast(value, dest_ty)
909+
let usize_value = self.intcast(value, self.cx.type_isize(), false);
910+
self.cx.const_bitcast(usize_value, dest_ty)
915911
}
916912

917913
fn bitcast(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {

0 commit comments

Comments
 (0)