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

fix @ptrFromInt to create a 0x0 address for ?*allowzero T instead of null #21846

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rexicon226
Copy link
Contributor

closes #21775

@nektro
Copy link
Contributor

nektro commented Oct 29, 2024

why would that not be a compile error? allowzero and ? are mutually exclusive with regards to not increasing the size of the pointer, so having both shouldnt still be considered a pointer type. eg @sizeOf(?*allowzero T) will be 16 not 8 on 64bit platforms

@xdBronch
Copy link
Contributor

same reason const n: ?u32 = @intCast(a); or anything else like that works

@nektro
Copy link
Contributor

nektro commented Oct 29, 2024

it does? 😳 TIL
I... definitely did not expect that

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.

@ptrFromInt(0) on ?*allowzero T gives null
3 participants