Support branch statements break/continue/fallthrough

This commit is contained in:
gingerBill
2023-07-19 14:19:01 +01:00
parent 184563bbe1
commit b2edab193f
2 changed files with 14 additions and 8 deletions
+2 -6
View File
@@ -1330,14 +1330,10 @@ gb_internal void cg_build_stmt(cgProcedure *p, Ast *node) {
}
}
}
if (block != nullptr) {
cg_emit_defer_stmts(p, cgDeferExit_Branch, block);
}
GB_ASSERT(block != nullptr);
cg_emit_defer_stmts(p, cgDeferExit_Branch, block);
tb_inst_goto(p->func, block);
tb_inst_set_control(p->func, block);
tb_inst_unreachable(p->func);
tb_inst_set_control(p->func, prev_block);
case_end;