Add check for SWITCH targets

This commit is contained in:
Dmitry Stogov 2023-01-18 09:37:30 +03:00
parent 397ed1696b
commit 211677e2c2

View File

@ -248,6 +248,10 @@ bool ir_check(ir_ctx *ctx)
switch (insn->op) {
case IR_SWITCH:
/* may have many successors */
if (use_list->count < 1) {
fprintf(stderr, "ir_base[%d].op (SWITCH) must have at least 1 succesor (%d)\n", i, use_list->count);
ok = 0;
}
break;
case IR_IF:
if (use_list->count != 2) {