Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of undef values in llvm codegen #1729

Open
dgrove-oss opened this issue Feb 28, 2023 · 0 comments
Open

Better handling of undef values in llvm codegen #1729

dgrove-oss opened this issue Feb 28, 2023 · 0 comments
Labels
kind: bug 🪲 An error in the implementation code or documentation

Comments

@dgrove-oss
Copy link
Collaborator

I (re)discovered today that the UndefinedLiteral doesn't quite do what its header comment says:

The undefined value. Usage of an undefined value results in a compilation error.

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 an ioctl 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.

@dgrove-oss dgrove-oss added the kind: bug 🪲 An error in the implementation code or documentation label Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug 🪲 An error in the implementation code or documentation
Projects
None yet
Development

No branches or pull requests

1 participant