From e7424e1496937df5d7bb194a100013854f2a56bf Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 30 Jan 2011 21:43:56 +0900 Subject: [PATCH] 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. --- tools/qfcc/source/statements.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index 7ab52ae04..d448a7aaf 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -758,8 +758,10 @@ statement_uexpr (sblock_t *sblock, expr_t *e) if (!e->e.expr.e1 && !options.traditional) opcode = ""; 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;