2 ms·
LLVM undef does not mean "undefined behavior", it means that it's OK to transform any use of it into the use of an arbitrary value (potentially different, unles
by devit 6y ago
LLVM undef does not mean "undefined behavior", it means that it's OK to transform any use of it into the use of an arbitrary value (potentially different, unless the freeze instruction is used).
To get undefined behavior, you need to do something like use the unreachable instruction, or call a noreturn function that does in fact return. You may also have "poison values", which trigger undefined behavior on certain uses.