summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-06-16 17:55:41 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-06-16 17:55:41 -0400
commit67c267a93a1c019e0506bfe16cbad5d06a53eb28 (patch)
treec99edae5bd8e8f9eec614f9841fdc35c27324937
parente327fd94f3be22d9129b252102e73b5bfb3b3276 (diff)
Check return type, not function type
-rw-r--r--graph.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/graph.c b/graph.c
index 837a2d8..a7f3b7f 100644
--- a/graph.c
+++ b/graph.c
@@ -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);