News for hackers. Stuff that matters.
Re:Git Security Vulnerabilities Announced by weinzierl on Tuesday January 17, 2023 @05:43PM (#34420565)
Because saturating math is not "more right", just "different wrong". The "right" way of checking an error condition after every integer operation is prohibitively expensive.

From the language side, what I wish for is a sort of NaN for integer operations. I would not want to check for overflow on every operation, but I would want to know after a couple of them if somewhere an overflow had occurred. On the hardware side this could be done with a sticky overflow bit, which some architectures already support.

I think the ball is on the hardware side and in my opinion Rust did the most sensible thing possible with contemporary hardware.

There are no comments on this comment yet.