commit 6aa84a53d8330534396129492073f269321e822a
parent c8555dd82d94cef6cb3ee87210a3e5bc8593d1be
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 19 Dec 2020 10:56:43 -0500
check_function: assign body to declaration
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/check.c b/src/check.c
@@ -137,6 +137,7 @@ check_function(struct context *ctx,
struct expression *body = calloc(1, sizeof(struct expression));
check_expression(ctx, &afndecl->body, body);
+ decl->func.body = body;
// TODO: Check assignability of expression result to function type
@@ -156,6 +157,7 @@ check_function(struct context *ctx,
expect(body->type != EXPR_LIST || body->terminates,
"This function never terminates. Add a return statement or @noreturn.");
}
+
trleave(TR_CHECK, NULL);
}