News for hackers. Stuff that matters.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by masklinn on Friday April 21, 2017 @07:29AM (#14164583)
> For such inlining optimization it is the compiler that 'introduces' the UB in its intermediate step.

Technically the UB is in the original code, it's the dereferencing of a pointer without checking it. The compiler can merely use that to assert dead code (checking for a null pointer after having already deref'd the pointer is nonsensical) and optimise it away.

Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by jononor on Friday April 21, 2017 @07:47AM (#14164650)
I don't support this unsafe compiler behavior. There should be a check on the pointer in sight, or a manual declaration that "this is safe, trust me". Otherwise, emit a UB warning...
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by adrianN on Friday April 21, 2017 @09:20AM (#14165283)
Then you want to use a different language. Java for example throws NullPointerException instead of having UB for null pointer accesses.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by benibela on Friday April 21, 2017 @01:25PM (#14167473)
Object Pascal just calls the function with this == null (well self = nil)
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by adrianN on Friday April 21, 2017 @01:45PM (#14167636)
ON ERROR RESUME NEXT