diff options
Diffstat (limited to 'src/compiler.c')
-rw-r--r-- | src/compiler.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler.c b/src/compiler.c index 6f9cc92..50678d8 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -47,9 +47,13 @@ static CHECK_RESULT int create_default_type(amal_compiler *compiler, const char return_if_error(structdecl_init(struct_decl, &compiler->root_scope, &compiler->allocator)); return_if_error(scoped_allocator_alloc(&compiler->allocator, sizeof(LhsExpr), (void**)&lhs_expr)); - lhsexpr_init(lhs_expr, bool_true, bool_true, create_buffer_view(name, strnlen(name, PATH_MAX))); + return_if_error(lhsexpr_init(lhs_expr, bool_true, bool_true, + create_buffer_view(name, strnlen(name, PATH_MAX)), + NULL)); ast_init(&lhs_expr->rhs_expr, struct_decl, AST_STRUCT_DECL); ast_init(&expr, lhs_expr, AST_LHS); + expr.resolved_type = lhs_expr; + expr.resolve_status = AST_RESOLVED; return scope_add_child(&compiler->root_scope, &expr); } |