Skip to content

Commit

Permalink
Fix GH-103: ir_check diagnosing ir_VAR before ir_PARAM
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Jan 21, 2025
1 parent e9e5369 commit 02909bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ir_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ bool ir_check(const ir_ctx *ctx)
ok = 0;
}
break;
case IR_PARAM:
if (i > 2 && ctx->ir_base[i - 1].op != IR_PARAM) {
fprintf(stderr, "ir_base[%d].op PARAMs must be used only right after START\n", i);
ok = 0;
}
break;
}

if (ctx->use_lists) {
Expand Down

0 comments on commit 02909bc

Please sign in to comment.