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

@ptrFromInt(0) on ?*allowzero T gives null #21775

Open
xdBronch opened this issue Oct 23, 2024 · 0 comments · May be fixed by #21846
Open

@ptrFromInt(0) on ?*allowzero T gives null #21775

xdBronch opened this issue Oct 23, 2024 · 0 comments · May be fixed by #21846
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@xdBronch
Copy link
Contributor

Zig Version

0.14.0-dev.1951+857383689

Steps to Reproduce and Observed Behavior

comptime {
    @compileLog(@as(?*allowzero const u8, @ptrFromInt(0)));
}
Compile Log Output:
@as(?*allowzero const u8, null)

this feels very unexpected to me

Expected Behavior

pointer should be the same as @as(*allowzero const u8, @ptrFromInt(0))

@xdBronch xdBronch added the bug Observed behavior contradicts documented or intended behavior label Oct 23, 2024
@Vexu Vexu added the frontend Tokenization, parsing, AstGen, Sema, and Liveness. label Oct 23, 2024
@Vexu Vexu added this to the 0.14.0 milestone Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants