X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast.c;h=7d84d0b451e0e76956284897ed2ea49d3875a3ed;hb=07611ee0ac745341d7d8ea4874b1cba13df0abab;hp=036c7c73892f82e88d24b6342c53eae0cf3f7131;hpb=08631b9f903d354b9ef787bc71d8e2ba728d98ce;p=cparser diff --git a/ast.c b/ast.c index 036c7c7..7d84d0b 100644 --- a/ast.c +++ b/ast.c @@ -879,10 +879,14 @@ static void print_compound_statement(const compound_statement_t *block) */ static void print_return_statement(const return_statement_t *statement) { - fputs("return ", out); - if (statement->value != NULL) - print_expression(statement->value); - fputs(";\n", out); + expression_t const *const val = statement->value; + if (val != NULL) { + fputs("return ", out); + print_expression(val); + fputs(";\n", out); + } else { + fputs("return;\n", out); + } } /**