avoid division overflow in idivmod test
This commit is contained in:
parent
9d74cf08b8
commit
bfa92a862b
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user