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

Don't allow signed pointer comparison. #1561

Merged
merged 1 commit into from
Jan 24, 2025
Merged

Conversation

ltratt
Copy link
Contributor

@ltratt ltratt commented Jan 24, 2025

The LLVM manual is unclear as to whether signed pointer comparisons are allowed. I can't see that they make sense, and I haven't yet encountered such things, so I prefer to panic if we do see them: this means that I no longer need to worry about zero/sign extending pointers in the optimiser.

[Note: ptrdiff_t-esque things clearly can be signed. But I'm not sure that pointers per se make sense as being signed.]

The LLVM manual is unclear as to whether signed pointer comparisons are
allowed. I can't see that they make sense, and I haven't yet encountered
such things, so I prefer to `panic` if we do see them: this means that I
no longer need to worry about zero/sign extending pointers in the
optimiser.

[Note: `ptrdiff_t`-esque things clearly can be signed. But I'm not sure
that pointers per se make sense as being signed.]
@vext01
Copy link
Contributor

vext01 commented Jan 24, 2025

I agree! :)

@vext01 vext01 added this pull request to the merge queue Jan 24, 2025
Merged via the queue into ykjit:master with commit 763be58 Jan 24, 2025
2 checks passed
@ltratt ltratt deleted the bork_signed_ptrs branch January 24, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants