@moderators could you split this discussion of uninit memory (starting here I'd say) into a separate thread? Thanks.
Do you have a link for this?
Your interpretation seems to be that even just a read of uninit memory is considered UB in LLVM. I do not think this is true, and in particular it is not true in this formal model of LLVM of which John Regehr is a coauthor. Instead, this model says that reading uninit memory produces a poison
value, and as long as you don't do a conditional branch on it, you are fine -- but any computation into which poison
flows, returns poison
.