interpret: use new OpTy::len for Len rvalue
This avoids a `force_allocation`
This commit is contained in:
parent
7f442f8ba1
commit
d814d10069
@ -251,8 +251,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
|
||||
Len(place) => {
|
||||
let src = self.eval_place(place)?;
|
||||
let mplace = self.force_allocation(&src)?;
|
||||
let len = mplace.len(self)?;
|
||||
let op = self.place_to_op(&src)?;
|
||||
let len = op.len(self)?;
|
||||
self.write_scalar(Scalar::from_machine_usize(len, self), &dest)?;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user