interpret: refactor projection code to work on a common trait, and use that for visitors
This commit is contained in:
@@ -38,9 +38,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
// With randomized layout, `(int, bool)` might cease to be a `ScalarPair`, so we have to
|
||||
// do a component-wise write here. This code path is slower than the above because
|
||||
// `place_field` will have to `force_allocate` locals here.
|
||||
let val_field = self.place_field(&dest, 0)?;
|
||||
let val_field = self.project_field(dest, 0)?;
|
||||
self.write_scalar(val, &val_field)?;
|
||||
let overflowed_field = self.place_field(&dest, 1)?;
|
||||
let overflowed_field = self.project_field(dest, 1)?;
|
||||
self.write_scalar(Scalar::from_bool(overflowed), &overflowed_field)?;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user