diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-06-16 17:55:41 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-06-16 17:55:41 -0400 |
commit | 67c267a93a1c019e0506bfe16cbad5d06a53eb28 (patch) | |
tree | c99edae5bd8e8f9eec614f9841fdc35c27324937 | |
parent | e327fd94f3be22d9129b252102e73b5bfb3b3276 (diff) |
Check return type, not function type
-rw-r--r-- | graph.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -53,20 +53,20 @@ graph_function (ast_function_definition_t *function) node = node_insert_after (function->end, node); node = node_insert_after (function->exit, node); - if (function->type_spec->common.type == AST_VOID_TYPE) + if (function->return_type->common.type == AST_VOID_TYPE) { /* Dummy return value. This is useful because it means * function calls will always leave something on the - * stack. That mean void functions are called in the - * same way as non-void functions, and that makes - * it possible to cast non-void function pointers to - * void function pointers + * stack, ie., non-void functions are called in the + * same way as non-void functions, which makes it + * possible to cast non-void function pointers to + * void function pointers. */ value_t value; value.int32_val = 0; - node = node_new_literal (value, function->type_spec, node, ast); + node = node_new_literal (value, function->return_type, node, ast); } node = node_new_return (function->return_type, node, ast); |