mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Don't segfault on bare return statements.
I will probably need to do something about the required operand for v6 progs, but this will do for now.
This commit is contained in:
parent
440a13b649
commit
e7424e1496
1 changed files with 4 additions and 2 deletions
|
@ -758,8 +758,10 @@ statement_uexpr (sblock_t *sblock, expr_t *e)
|
|||
if (!e->e.expr.e1 && !options.traditional)
|
||||
opcode = "<RETURN_V>";
|
||||
s = new_statement (opcode);
|
||||
sblock = statement_subexpr (sblock, e->e.expr.e1, &s->opa);
|
||||
s->opa->type = ev_void;
|
||||
if (e->e.expr.e1) {
|
||||
sblock = statement_subexpr (sblock, e->e.expr.e1, &s->opa);
|
||||
s->opa->type = ev_void;
|
||||
}
|
||||
sblock_add_statement (sblock, s);
|
||||
sblock->next = new_sblock ();
|
||||
sblock = sblock->next;
|
||||
|
|
Loading…
Reference in a new issue