Fix SelectorCallExpr with no return values

This commit is contained in:
gingerBill
2020-05-22 23:41:17 +01:00
parent fd6e2ed5de
commit 26fe9b0212
3 changed files with 19 additions and 3 deletions
+8 -1
View File
@@ -9029,7 +9029,7 @@ lbValue lb_build_expr(lbProcedure *p, Ast *expr) {
GB_ASSERT(se->modified_call);
TypeAndValue tav = type_and_value_of_expr(expr);
GB_ASSERT(tav.mode != Addressing_Invalid);
return lb_addr_load(p, lb_build_addr(p, se->call));
return lb_build_expr(p, se->call);
case_end;
case_ast_node(te, TernaryExpr, expr);
@@ -9571,6 +9571,13 @@ lbAddr lb_build_addr(lbProcedure *p, Ast *expr) {
}
case_end;
case_ast_node(se, SelectorCallExpr, expr);
GB_ASSERT(se->modified_call);
TypeAndValue tav = type_and_value_of_expr(expr);
GB_ASSERT(tav.mode != Addressing_Invalid);
return lb_build_addr(p, se->call);
case_end;
case_ast_node(ta, TypeAssertion, expr);
gbAllocator a = heap_allocator();
TokenPos pos = ast_token(expr).pos;