Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
  • Loading branch information
RalfJung and oli-obk authored Jun 24, 2019
1 parent 4d65aa8 commit 7e7b5d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl<'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'mir, 'tcx> {
// on read hardware this can easily happen. Thus for comparisons we require
// both pointers to be live.
if self.pointer_inbounds(left).is_ok() && self.pointer_inbounds(right).is_ok() {
// Two in-bounds pointers in different allocatons are different.
// Two in-bounds pointers in different allocations are different.
false
} else {
return err!(InvalidPointerMath);
Expand Down
2 changes: 1 addition & 1 deletion tests/compile-fail/zst3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fn main() {
// (that are out-of-bounds).
let mut x_box = Box::new(1u8);
let x = (&mut *x_box as *mut u8).wrapping_offset(1);
// This one is just "at the egde", but still okay
// This one is just "at the edge", but still okay
unsafe { *(x as *mut [u8; 0]) = zst_val; }
// One byte further is OOB.
let x = x.wrapping_offset(1);
Expand Down

0 comments on commit 7e7b5d4

Please sign in to comment.