mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-25 12:41:19 +00:00
ir_block_create_{phi,call} now check self->final
This commit is contained in:
parent
384446316a
commit
bf267d0238
1 changed files with 8 additions and 0 deletions
8
ir.c
8
ir.c
|
@ -1525,6 +1525,10 @@ ir_instr* ir_block_create_phi(ir_block *self, lex_ctx ctx, const char *label, in
|
||||||
{
|
{
|
||||||
ir_value *out;
|
ir_value *out;
|
||||||
ir_instr *in;
|
ir_instr *in;
|
||||||
|
if (self->final) {
|
||||||
|
irerror(self->context, "unreachable statement (%s)", self->label);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
in = ir_instr_new(ctx, self, VINSTR_PHI);
|
in = ir_instr_new(ctx, self, VINSTR_PHI);
|
||||||
if (!in)
|
if (!in)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1570,6 +1574,10 @@ ir_instr* ir_block_create_call(ir_block *self, lex_ctx ctx, const char *label, i
|
||||||
{
|
{
|
||||||
ir_value *out;
|
ir_value *out;
|
||||||
ir_instr *in;
|
ir_instr *in;
|
||||||
|
if (self->final) {
|
||||||
|
irerror(self->context, "unreachable statement (%s)", self->label);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
in = ir_instr_new(ctx, self, (noreturn ? VINSTR_NRCALL : INSTR_CALL0));
|
in = ir_instr_new(ctx, self, (noreturn ? VINSTR_NRCALL : INSTR_CALL0));
|
||||||
if (!in)
|
if (!in)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue