Fix regression, constant variables now get properly rewritten

This commit is contained in:
Krzosa Karol
2022-05-31 14:01:18 +02:00
parent 369418b042
commit 04d38511a9
7 changed files with 49 additions and 68 deletions

View File

@@ -147,7 +147,7 @@ gen_expr(Ast_Expr *ast){
CASE(CALL, Call){
// @todo: Reach into map instead of direct lookup
if(node->type->kind == TYPE_STRUCT){ // @todo: Should this be type_type maybe???
if(is_struct(node->type) || is_array(node->type)){ // @todo: Should this be type_type maybe???
gen("(");
gen_simple_decl(node->type, {});
gen(")");