Fix issue with printing invalid IR for nested unions

(GitHub #4)
This commit is contained in:
Ginger Bill
2016-12-17 10:23:28 +00:00
parent d4457e9fa4
commit 625b98eac4
4 changed files with 20 additions and 14 deletions
+2
View File
@@ -1579,12 +1579,14 @@ ssaValue *ssa_emit_union_tag_ptr(ssaProcedure *proc, ssaValue *u) {
Type *t = ssa_type(u);
GB_ASSERT(is_type_pointer(t) &&
is_type_union(type_deref(t)));
GB_ASSERT(are_types_identical(t, ssa_type(u)));
return ssa_emit(proc, ssa_make_instr_union_tag_ptr(proc, u));
}
ssaValue *ssa_emit_union_tag_value(ssaProcedure *proc, ssaValue *u) {
Type *t = ssa_type(u);
GB_ASSERT(is_type_union(t));
GB_ASSERT(are_types_identical(t, ssa_type(u)));
return ssa_emit(proc, ssa_make_instr_union_tag_value(proc, u));
}