Richard Henderson <r...@twiddle.net> writes: > On 07/23/2016 02:14 PM, Nikunj A Dadhania wrote: [...] > Basically, we check for the offending cases and modify the divisor prior to > the > division. For unsigned: > > a / (b == 0 ? 1 : b) > > For signed: > > a / ((a == INT_MAX & b == -1) | (b == 0) ? : b)
So when we change the divisor to 1, undefined result is set as "a". Hope that should be fine and doesnt break anything :-) Regards, Nikunj