Add parse_int; Fix union bugs with size, alignment, and recursive definition checking

This commit is contained in:
Ginger Bill
2017-04-14 21:47:59 +01:00
parent 0d2dbee84e
commit 23a0a6de4b
6 changed files with 135 additions and 35 deletions
+4
View File
@@ -601,6 +601,8 @@ void check_union_type(Checker *c, Type *union_type, AstNode *node) {
union_type->Record.fields = fields;
union_type->Record.field_count = field_count;
union_type->Record.are_offsets_set = false;
for_array(i, ut->variants) {
AstNode *variant = ut->variants.e[i];
@@ -668,6 +670,8 @@ void check_union_type(Checker *c, Type *union_type, AstNode *node) {
add_entity_use(c, f->name, e);
}
type_set_offsets(c->allocator, union_type);
gb_temp_arena_memory_end(tmp);
union_type->Record.variants = variants;