Skip to content

Commit 69e8318

Browse files
committed
de-obfuscate ptr comparison a bit
1 parent 4dc188a commit 69e8318

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/operator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ impl<'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'mir, 'tcx> {
193193
// on read hardware this can easily happen. Thus for comparisons we require
194194
// both pointers to be live.
195195
if self.pointer_inbounds(left).is_ok() && self.pointer_inbounds(right).is_ok() {
196-
// Two in-bounds pointers, we can compare across allocations.
197-
left == right
196+
// Two in-bounds pointers in different allocatons are different.
197+
false
198198
} else {
199199
return err!(InvalidPointerMath);
200200
}

0 commit comments

Comments
 (0)