aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-06-07 10:47:47 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit53a331bc8b2fc33bd2b7e25a23b4128f89ee0b52 (patch)
tree2e5c0f4cda85b2afdb6142145fa7ded61d100f02 /src/compiler.c
parent1b68fdcf5aebf2bc53bbd9234c77aea243c0decd (diff)
Add assignment, while, extern, function signature type, start on bytecode
Diffstat (limited to 'src/compiler.c')
-rw-r--r--src/compiler.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler.c b/src/compiler.c
index 30a583a..bdcb1c8 100644
--- a/src/compiler.c
+++ b/src/compiler.c
@@ -40,7 +40,7 @@ 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));
- return_if_error(lhsexpr_init(*lhs_expr, bool_true, bool_true,
+ return_if_error(lhsexpr_init(*lhs_expr, bool_true, bool_true, bool_true,
create_buffer_view(name, strnlen(name, PATH_MAX)),
&compiler->allocator));
return_if_error(ast_create(&compiler->allocator, struct_decl, AST_STRUCT_DECL, &(*lhs_expr)->rhs_expr));
@@ -242,6 +242,7 @@ static CHECK_RESULT int thread_generate_ssa(Parser *parser) {
return_if_error(scoped_allocator_alloc(parser->allocator, sizeof(Ssa), (void**)&compiler_context.ssa));
return_if_error(ssa_init(compiler_context.ssa, parser->allocator));
+ compiler_context.compiler = parser->compiler;
parser->ssa = compiler_context.ssa;
amal_log_debug("Generating SSA for file: %.*s", parser->tokenizer.code_name.size, parser->tokenizer.code_name.data);
result = setjmp(compiler_context.env);