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

Make sure offset(0) is handled correctly #515

Open
RalfJung opened this issue May 10, 2024 · 0 comments
Open

Make sure offset(0) is handled correctly #515

RalfJung opened this issue May 10, 2024 · 0 comments
Labels
libgccjit requires a change in libgccjit

Comments

@RalfJung
Copy link
Member

The offset intrinsic (called inbounds_gep in the codegen_ssa API) is now always defined when the offset is 0, even if the pointer is 0 or dangling.

The GCC backend uses new_array_access to model that; it is important to make sure that if the index is 0, this is never UB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgccjit requires a change in libgccjit
Projects
None yet
Development

No branches or pull requests

2 participants