Closed kbara closed 9 years ago
There are actually at least two bugs here 1) The wrong result 2) If we can optimize out a division, we should also be able to optimize out the check that weŕe not dividing by zero.
In this case we can't optimize out the division though; its result is either 1 or 0, and a len
value of 0 would indeed trigger an abort. Not that we should really see a zero-length packet!
Agreed, but in cases where we can optimize out the division, we definitely shouldn't leave the != 0 check in.
Sure, but leaving in the check is not a correctness bug, is all I'm saying :)
Agreed, just an anti-optimization. :)
Fixed in #123.