bug fixes

This commit is contained in:
2026-07-13 23:34:14 +02:00
parent 0eeacc2e37
commit 0b0b00a050
6 changed files with 114 additions and 17 deletions
+8 -1
View File
@@ -468,7 +468,7 @@ lower_compound_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instructi
diagnostic=source.INVALID_DIAGNOSTIC,
})
} else {
if expr.integer != 0 {
if expr.integer != hir.CATCH_EXPRESSION {
capture := hir.as_local(expr.target)
if capture != hir.INVALID_LOCAL && int(capture) < len(state.func_locals) {
error_type := state.func_locals[capture].type
@@ -491,6 +491,13 @@ lower_compound_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instructi
})
}
lower_statements(state, expr.body)
if expr.integer == hir.CATCH_VOID_FALLTHROUGH {
append_instruction(state, ir.Instruction{
op=.Br, span=expr.span, type=types.VOID, integer=merge_lbl,
target=ir.INVALID_REF, a=ir.INVALID_INSTRUCTION, b=ir.INVALID_INSTRUCTION,
diagnostic=source.INVALID_DIAGNOSTIC,
})
}
}
if expr.right != hir.INVALID_EXPR {
fallback := lower_nested_expr(state, expr.right)