Use precomputed TyLayout from machine.layouts

And add comment documenting successful return value from
`mach_timebase_info`.
This commit is contained in:
Samrat Man Singh
2020-04-14 13:31:24 +05:30
parent f6bb8111f2
commit 90729bb039
+3 -4
View File
@@ -173,13 +173,12 @@ fn mach_timebase_info(&mut self, info_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx,
// `mach_absolute_time`, we don't need to scale the absolute
// time.
let (numer, denom) = (1,1);
let uint32_layout = this.layout_of(this.tcx.types.u32)?;
let imms = [
immty_from_int_checked(numer, uint32_layout)?,
immty_from_int_checked(denom, uint32_layout)?
immty_from_int_checked(numer, this.machine.layouts.u32)?,
immty_from_int_checked(denom, this.machine.layouts.u32)?
];
this.write_packed_immediates(info, &imms)?;
Ok(0)
Ok(0) // KERN_SUCCESS
}
}