4 ms·
So the pseudocode: if (p is not NULL) { dereference p } is UB? That's crazy, but not actually unbelievable.
by mnw21cam 4y ago
So the pseudocode:
if (p is not NULL) {
dereference p
}
is UB? That's crazy, but not actually unbelievable.
- dllthomas 4y agoI am not certain of the language lawyer side of it, but no reasonable (or even moderately unreasonable) compiler would omit that check because of the guarded behavior; way too much code would break, probably including that compiler's standard library.
- UncleMeat 4y agoThe poster is just completely wrong. A compiler is required to emit the branch in this case.