commit 1e9a3340c9007708fa3afbcb62bb8da290c8e7a2
parent 40faec131c8e46d9a621e6bc98220538c4ac177b
Author: Drew DeVault <sir@cmpwn.com>
Date: Thu, 1 Jul 2021 11:20:00 -0400
gen: add TODO regarding return values
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/gen.c b/src/gen.c
@@ -190,6 +190,8 @@ gen_function_decl(struct gen_context *ctx, const struct declaration *decl)
gen_expr(ctx, func->body, ctx->rval);
if (type_dealias(fntype->func.result)->storage != STORAGE_VOID) {
+ // XXX: This is incorrect; we need to load the value from the
+ // stack
struct qbe_value rval = {0};
qval_temp(ctx, &rval, ctx->rval);
pushi(ctx->current, NULL, Q_RET, &rval, NULL);