aboutsummaryrefslogtreecommitdiff
path: root/src/generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/generator.c')
-rw-r--r--src/generator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/generator.c b/src/generator.c
index 82c492b..d380f36 100644
--- a/src/generator.c
+++ b/src/generator.c
@@ -444,6 +444,9 @@ void generate_function_header(Node *func, FILE *out)
void generate_function(Node *func, FILE *out)
{
assert(func->type == AST_FUNC);
+ // This will happen for declarations.
+ if (func->func.body == NULL)
+ return;
current_function = func;
generate_function_header(func, out);
generate_block(func->func.body, out);