avoid division overflow in idivmod test

This commit is contained in:
Jorge Aparicio 2016-09-17 21:10:41 -05:00
parent 9d74cf08b8
commit bfa92a862b

View File

@ -193,7 +193,7 @@ mod tests {
fn idivmod(n: U32, d: U32) -> TestResult { fn idivmod(n: U32, d: U32) -> TestResult {
let (n, d) = (n.0 as i32, d.0 as i32); let (n, d) = (n.0 as i32, d.0 as i32);
if d == 0 { if d == 0 || (n == i32::min_value() && d == -1) {
TestResult::discard() TestResult::discard()
} else { } else {
let q: i32; let q: i32;