Better handling of undef
values in llvm codegen
#1729
Labels
kind: bug 🪲
An error in the implementation code or documentation
undef
values in llvm codegen
#1729
I (re)discovered today that the UndefinedLiteral doesn't quite do what its header comment says:
If we interpret a reference to
UndefinedLiteral
, we get a compilation error. -- Good.But if we execute generated code that reads an llvm
undef
literal we don't trap...we just execute something with ill-defined semantics. In particular, I had messed up a header file for a constant used in anioctl
and we were just merrily executing it, getting back a-1
because the constant wasn't valid and blundering along to fail later. -- Not good, as it took a while to realize what was happening.It would be much better if we could instead generated a trap or something that would cause a more obvious failure if it was actually reached at runtime.
The text was updated successfully, but these errors were encountered: