Skip to content

Commit

Permalink
Bootstra: Don't crash on structs with no fields
Browse files Browse the repository at this point in the history
  • Loading branch information
N00byEdge committed Oct 8, 2023
1 parent c08162f commit f0a6883
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bootstrap/sema.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ pub const Struct = struct {
}

pub fn getAlignment(self: *@This()) anyerror!u32 {
var alignment: u32 = 0;
var alignment: u32 = 1;
var curr_field = self.first_field;
while(container_fields.getOpt(curr_field)) |field| : (curr_field = field.next) {
const field_type = types.get(try values.get(field.init_value).getType());
Expand Down

0 comments on commit f0a6883

Please sign in to comment.