1
Fork 0

Update interpret step

This commit is contained in:
kadmin 2020-11-07 00:49:55 +00:00
parent 89f45ed9f3
commit 37a6c04718
3 changed files with 13 additions and 3 deletions

View file

@ -119,15 +119,23 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let dst = { let dst = {
let dst = self.eval_operand(dst, None)?; let dst = self.eval_operand(dst, None)?;
dst.assert_mem_place(self) let mplace = *dst.assert_mem_place(self);
match mplace.ptr {
Scalar::Ptr(ptr) => ptr,
_ => panic!(),
}
}; };
let src = { let src = {
let src = self.eval_operand(src, None)?; let src = self.eval_operand(src, None)?;
src.assert_mem_place(self) let mplace = *src.assert_mem_place(self);
match mplace.ptr {
Scalar::Ptr(ptr) => ptr,
_ => panic!(),
}
}; };
// Not sure how to convert an MPlaceTy<'_, <M as Machine<'_, '_>>::PointerTag> // Not sure how to convert an MPlaceTy<'_, <M as Machine<'_, '_>>::PointerTag>
// to a pointer, or OpTy to a size // to a pointer, or OpTy to a size
self.memory.copy(src, dst, size, /*nonoverlapping*/ true)?; self.memory.copy(src, dst, size.layout.layout.size, /*nonoverlapping*/ true)?;
} }
// Statements we do not track. // Statements we do not track.

View file

@ -687,6 +687,7 @@ pub(super) fn filtered_statement_span(
// Retain spans from all other statements // Retain spans from all other statements
StatementKind::FakeRead(_, _) // Not including `ForGuardBinding` StatementKind::FakeRead(_, _) // Not including `ForGuardBinding`
| StatementKind::CopyNonOverlapping(..)
| StatementKind::Assign(_) | StatementKind::Assign(_)
| StatementKind::SetDiscriminant { .. } | StatementKind::SetDiscriminant { .. }
| StatementKind::LlvmInlineAsm(_) | StatementKind::LlvmInlineAsm(_)

View file

@ -428,6 +428,7 @@ impl Visitor<'_> for UsedLocals {
fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) { fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {
match statement.kind { match statement.kind {
StatementKind::LlvmInlineAsm(..) StatementKind::LlvmInlineAsm(..)
| StatementKind::CopyNonOverlapping(..)
| StatementKind::Retag(..) | StatementKind::Retag(..)
| StatementKind::Coverage(..) | StatementKind::Coverage(..)
| StatementKind::FakeRead(..) | StatementKind::FakeRead(..)