You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to do some fuzzing for this crate, and I found some panics related to overflow. I have filtered some panics which I think it is not a bug. But there still have some panics I wonder if it is a bug. I list the code snippets below.
I believe this one is a bug.
let _:i8 = num::integer::mod_floor(-128, -1);// panic at 'attempt to calculate the remainder with overflow'
The expected output of mod_floor is 0, which is not out of range of i8. The problem also exists on other types.
The following cases are caused by out of range result. I wonder if they should be considered as bugs.
let _:(i8,i8) = num::integer::div_rem(-128, -1);// panic at 'attempt to divide with overflow'let _:i8 = num::traits::sign::abs(-128);// panic at 'attempt to negate with overflow'let _:i64 = num::abs_sub(3544668469065756977, -9209525551093438927);// panic at 'attempt to subtract with overflow'let _:(u128,u128) = num::integer::gcd_lcm(12009965891327239886941778839922608393,12009965891328373236456281444243278208);// panic at 'attempt to multiply with overflow'let _:u8 = num::integer::lcm(255,127);// panic at 'attempt to multiply with overflow'
The text was updated successfully, but these errors were encountered:
The mod_floor panics are consistent with Rust's % operator -- e.g. i8::MIN % -1 also panics.
The following cases are caused by out of range result. I wonder if they should be considered as bugs.
They should be considered bugs in the code that provided those inputs. There's no correct value that the library can return, but some of them will use Rust's wrapping-overflow semantics in release mode instead of panicking.
Hi, I am trying to do some fuzzing for this crate, and I found some panics related to overflow. I have filtered some panics which I think it is not a bug. But there still have some panics I wonder if it is a bug. I list the code snippets below.
I believe this one is a bug.
The expected output of mod_floor is 0, which is not out of range of i8. The problem also exists on other types.
The following cases are caused by out of range result. I wonder if they should be considered as bugs.
The text was updated successfully, but these errors were encountered: