Use bitcast for ptrtoint and inttoptr
This works now
This commit is contained in:
parent
b48ed38482
commit
07afdb8c0d
2 changed files with 5 additions and 29 deletions
|
@ -904,11 +904,12 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
|
|||
}
|
||||
|
||||
fn ptrtoint(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {
|
||||
self.cx.ptrtoint(self.block, value, dest_ty)
|
||||
let usize_value = self.cx.const_bitcast(value, self.cx.type_isize());
|
||||
self.intcast(usize_value, dest_ty, false)
|
||||
}
|
||||
|
||||
fn inttoptr(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {
|
||||
self.cx.inttoptr(self.block, value, dest_ty)
|
||||
self.cx.const_bitcast(value, dest_ty)
|
||||
}
|
||||
|
||||
fn bitcast(&mut self, value: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue