-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Crash in InternPool when faulty packed struct
is inside an extern struct
#17859
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
Comments
Caused by |
pub fn haveFieldTypes(s: @This(), ip: *const InternPool) bool {
const types = s.field_types.get(ip);
- return types.len == 0 or types[0] != .none;
+ if (types.len == 0) return true;
+ if (types[types.len - 1] != .none) return s.layout == .Packed or !s.flagsPtr(ip).field_types_wip;
+ return false;
} I was working on a fix for this - the above diff prevents the crash but then there is an incorrect error on the 2nd analysis:
To trigger this you need Is this 2nd analysis supposed to be prevented by the |
It seems to work correct now as of 0.13.0 |
we should double check there's a test covering this before closing |
Zig Version
0.12.0-dev.1390+94cee4fb2
Steps to Reproduce and Observed Behavior
Trace of a debug build of the compiler
Expected Behavior
The compiler should correctly report the error:
The text was updated successfully, but these errors were encountered: