Compound expression for union

This commit is contained in:
Krzosa Karol
2023-03-29 10:06:55 +02:00
parent c9072711b5
commit cb630951fd
5 changed files with 40 additions and 9 deletions

View File

@@ -517,7 +517,7 @@ gen_expr(Ast_Expr *ast) {
}
For(node->exprs) {
if (is_struct(node->resolved_type))
if (is_struct(node->resolved_type) || is_union(node->resolved_type))
gen(".%Q = ", it->resolved_name);
else if (is_array(node->resolved_type))
gen("[%d] = ", (int)it->resolved_index);