Skip to content

Commit 4b9a7d8

Browse files
committed
fix error message details
1 parent 1f8cb47 commit 4b9a7d8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/operator.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::convert::TryFrom;
22

3-
use rustc::ty::{Ty, layout::{Size, Align, LayoutOf}};
3+
use rustc::ty::{Ty, layout::{Size, LayoutOf}};
44
use rustc::mir;
55

66
use crate::*;
@@ -110,14 +110,15 @@ impl<'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'mir, 'tcx> {
110110
let offset = offset
111111
.checked_mul(pointee_size)
112112
.ok_or_else(|| err_panic!(Overflow(mir::BinOp::Mul)))?;
113-
// We do this forst, to rule out overflows.
113+
// We do this first, to rule out overflows.
114114
let offset_ptr = ptr.ptr_signed_offset(offset, self)?;
115115
// What we need to check is that starting at `ptr`,
116116
// we could do an access of size `offset`. Alignment does not matter.
117-
self.memory.check_ptr_access(
117+
self.memory.check_ptr_access_align(
118118
ptr,
119119
Size::from_bytes(u64::try_from(offset).unwrap()),
120-
Align::from_bytes(1).unwrap(),
120+
None,
121+
CheckInAllocMsg::InboundsTest,
121122
)?;
122123
// That's it!
123124
Ok(offset_ptr)

0 commit comments

Comments
 (0)