harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5b50359c8ecf565c73a040445d6198e60bce1c28
parent 867863e01b9163167fae3f81fe3bf156e73da075
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 13 Aug 2021 10:22:42 +0200

gen: call result is non-xtype

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Msrc/gen.c | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -904,6 +904,7 @@ gen_expr_call(struct gen_context *ctx, const struct expression *expr) rval = mktemp(ctx, rtype->func.result, "returns.%d"); call.out = xcalloc(1, sizeof(struct qbe_value)); *call.out = mkqval(ctx, &rval); + call.out->type = qtype_lookup(ctx, rtype->func.result, false); } struct qbe_arguments *args, **next = &call.args; @@ -915,10 +916,7 @@ gen_expr_call(struct gen_context *ctx, const struct expression *expr) args = *next = xcalloc(1, sizeof(struct qbe_arguments)); struct gen_value arg = gen_expr(ctx, carg->value); args->value = mkqval(ctx, &arg); - if (args->value.type->stype == Q_BYTE - || args->value.type->stype == Q_WORD) { - args->value.type = &qbe_word; - } + args->value.type = qtype_lookup(ctx, carg->value->result, false); next = &args->next; } push(&ctx->current->body, &call);