1
Fork 0

Apply CR suggestions; add real tracking issue

This commit is contained in:
Scott McMurray 2022-04-10 16:02:52 -07:00
parent 4bb15b3797
commit 003b954a43
6 changed files with 14 additions and 10 deletions

View file

@ -377,6 +377,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
}
let pointee_layout = self.layout_of(substs.type_at(0))?;
// This re-interprets an isize at ret_layout, but we already checked
// that if ret_layout is usize, then the result must be non-negative.
let val = ImmTy::from_scalar(val, ret_layout);
let size = ImmTy::from_int(pointee_layout.size.bytes(), ret_layout);
self.exact_div(&val, &size, dest)?;