News for hackers. Stuff that matters.
Re:Efficient Integer Overflow Checking in LLVM (2016) by tom_mellior on Thursday September 24, 2020 @05:50AM (#24576969)
Why would OpenJDK do integer overflow checking? Java integers have well-defined two's complement wrapping semantics. When you add two positive numbers and get a negative result, this might not be what the programmer wanted, but it is not undefined behavior like it is in C.

Are you maybe mixing this up with array bounds checking?

Re:Efficient Integer Overflow Checking in LLVM (2016) by MaxBarraclough on Thursday September 24, 2020 @06:06AM (#24577047)
Oops, you're right! I forgot Java arithmetic wraps, offering (rarely used) methods for overflow-checked arithmetic. [0]

I was right about .Net though. Assuming a checked context, .Net (and C#) throw on overflow, rather than wrapping. [1]

[0] https://docs.oracle.com/en/java/javase/11/docs/api/java.base...

[1] https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...