aboutsummaryrefslogtreecommitdiff
path: root/src/ssa
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-09-18 14:28:12 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit142a13ad3f77c0ad1bd321d1a1f864a5117896d1 (patch)
tree9e7c89d3e1960ca833b01b4c7aafb27cc8a966b4 /src/ssa
parentab0c5259e5a3238e176e4b1aed942f5384a2d0c6 (diff)
Fix import func call build
Diffstat (limited to 'src/ssa')
-rw-r--r--src/ssa/ssa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ssa/ssa.c b/src/ssa/ssa.c
index d76ad28..9955d9d 100644
--- a/src/ssa/ssa.c
+++ b/src/ssa/ssa.c
@@ -658,7 +658,8 @@ static CHECK_RESULT SsaRegister funccall_generate_ssa(FunctionCall *self, SsaCom
assert(resolve_data->type.type == RESOLVED_TYPE_FUNC_SIG);
func_sig = resolve_data->type.value.func_sig;
} else {
- assert(bool_false);
+ assert(func_lhs_expr->rhs_expr && func_lhs_expr->rhs_expr->resolve_data.type.type == RESOLVED_TYPE_FUNC_SIG);
+ func_sig = func_lhs_expr->rhs_expr->resolve_data.type.value.func_sig;
}
func_decl = func_sig->func_decl;
@@ -775,7 +776,7 @@ static CHECK_RESULT SsaRegister binop_generate_ssa(Binop *self, SsaCompilerConte
const std = @import("std.amal");
std.printf
*/
- if(self->type == BINOP_DOT && self->rhs->resolve_data.type.type == RESOLVED_TYPE_FUNC_SIG) {
+ if(self->type == BINOP_DOT && self->rhs->type == AST_FUNCTION_CALL) {
Import *lhs_import = binop_lhs_get_import_or_null(self);
if(lhs_import)
context->import_index = 1 + lhs_import->file_scope->import_index;