Skip to content

Commit 4e45990

Browse files
eduardosmAmanieu
authored andcommitted
Avoid subtraction overflow in test_mm_store{,1,r}_ps functions
This overflow was found while testing core_arch with miri
1 parent d27bd19 commit 4e45990

File tree

1 file changed

+3
-3
lines changed
  • crates/core_arch/src/x86

1 file changed

+3
-3
lines changed

crates/core_arch/src/x86/sse.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,7 +3153,7 @@ mod tests {
31533153
let mut p = vals.as_mut_ptr();
31543154

31553155
if (p as usize) & 0xf != 0 {
3156-
ofs = ((16 - (p as usize)) & 0xf) >> 2;
3156+
ofs = (16 - ((p as usize) & 0xf)) >> 2;
31573157
p = p.add(ofs);
31583158
}
31593159

@@ -3179,7 +3179,7 @@ mod tests {
31793179

31803180
// Align p to 16-byte boundary
31813181
if (p as usize) & 0xf != 0 {
3182-
ofs = ((16 - (p as usize)) & 0xf) >> 2;
3182+
ofs = (16 - ((p as usize) & 0xf)) >> 2;
31833183
p = p.add(ofs);
31843184
}
31853185

@@ -3205,7 +3205,7 @@ mod tests {
32053205

32063206
// Align p to 16-byte boundary
32073207
if (p as usize) & 0xf != 0 {
3208-
ofs = ((16 - (p as usize)) & 0xf) >> 2;
3208+
ofs = (16 - ((p as usize) & 0xf)) >> 2;
32093209
p = p.add(ofs);
32103210
}
32113211

0 commit comments

Comments
 (0)