We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.12.0
test.zig
const struct_A = struct { b: struct_B, }; const struct_B = struct { a: struct_A, }; pub fn main() void { const s: struct_B = undefined; _ = s; }
Run with: zig run test.zig
zig run test.zig
This results in the compiler to segfault: [1] 59758 segmentation fault (core dumped) zig run test.zig
[1] 59758 segmentation fault (core dumped) zig run test.zig
I expected the compiler to throw an error message on mutually recursive structs not being allowed, instead it segfaults.
The text was updated successfully, but these errors were encountered:
The segfault happens because of infinite recursion in the compiler. Related #13724.
Back trace:
.... frame #18132: 0x0000000008955669 zig`type.Type.hasRuntimeBitsAdvanced at type.zig:585:64 frame #18133: 0x0000000008955669 zig`type.Type.hasRuntimeBitsAdvanced at type.zig:585:64 frame #18134: 0x0000000008955669 zig`type.Type.hasRuntimeBitsAdvanced at type.zig:585:64 frame #18135: 0x0000000008955669 zig`type.Type.hasRuntimeBitsAdvanced at type.zig:585:64 frame #18136: 0x0000000008955669 zig`type.Type.hasRuntimeBitsAdvanced at type.zig:585:64 frame #18137: 0x000000000851cab3 zig`Sema.typeHasRuntimeBits at Sema.zig:37679:37 frame #18138: 0x0000000009c55225 zig`Sema.addDbgVar at Sema.zig:6747:38 frame #18139: 0x00000000094b2f84 zig`Sema.zirDbgVar at Sema.zig:6727:23 frame #18140: 0x0000000008df6bce zig`Sema.analyzeBodyInner at Sema.zig:1317:35 frame #18141: 0x0000000008816252 zig`Sema.analyzeFnBody at Sema.zig:892:26
Sorry, something went wrong.
Can reproduce on 0.13.0, seems to be fixed on latest master.
No branches or pull requests
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
test.zig
Run with:
zig run test.zig
This results in the compiler to segfault:
[1] 59758 segmentation fault (core dumped) zig run test.zig
Expected Behavior
I expected the compiler to throw an error message on mutually recursive structs not being allowed, instead it segfaults.
The text was updated successfully, but these errors were encountered: