commit c9ca244381beb97ce49c08eb7c1dacbcb8c79f67
parent c5383c6cff89a4a03c89c60ba5c366a762b8713d
Author: Eyal Sawady <ecs@d2evs.net>
Date: Fri, 16 Jul 2021 11:37:03 +0000
gen: fix gen_copy for functions
Signed-off-by: Eyal Sawady <ecs@d2evs.net>
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gen.c b/src/gen.c
@@ -127,7 +127,6 @@ gen_copy(struct gen_context *ctx,
assert(0); // TODO
case STORAGE_ALIAS:
case STORAGE_FCONST:
- case STORAGE_FUNCTION:
case STORAGE_ICONST:
case STORAGE_VOID:
abort(); // Invariant
@@ -136,6 +135,7 @@ gen_copy(struct gen_context *ctx,
case STORAGE_ENUM:
case STORAGE_F32:
case STORAGE_F64:
+ case STORAGE_FUNCTION:
case STORAGE_I16:
case STORAGE_I32:
case STORAGE_I64:
diff --git a/src/qtype.c b/src/qtype.c
@@ -158,8 +158,9 @@ const struct qbe_type *qtype_lookup(
case STORAGE_TUPLE:
case STORAGE_UNION:
return aggregate_lookup(ctx, type);
- case STORAGE_VOID:
case STORAGE_FUNCTION:
+ return ctx->arch.ptr;
+ case STORAGE_VOID:
case STORAGE_NULL:
case STORAGE_FCONST:
case STORAGE_ICONST: