From 23a0a6de4b78bc5447d70cebfd792319ea2b7059 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Fri, 14 Apr 2017 21:47:59 +0100 Subject: Add parse_int; Fix union bugs with size, alignment, and recursive definition checking --- src/check_expr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/check_expr.c') diff --git a/src/check_expr.c b/src/check_expr.c index 24ac6dfc1..5d711afdf 100644 --- a/src/check_expr.c +++ b/src/check_expr.c @@ -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; -- cgit v1.2.3