From 8cd21e91ccee3baf15ad2f8cba9cbc4b618695a0 Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Sat, 1 Jun 2024 07:29:28 +0200 Subject: [PATCH] Address of solved for riscv64 A character size load was used instead of pointer size some times. --- riscv64-gen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv64-gen.c b/riscv64-gen.c index 76a9e49c0..5dea659f7 100644 --- a/riscv64-gen.c +++ b/riscv64-gen.c @@ -239,7 +239,7 @@ ST_FUNC void load(int r, SValue *sv) int func3, opcode = is_freg(r) ? 0x07 : 0x03, br; size = type_size(&sv->type, &align); assert (!is_freg(r) || bt == VT_FLOAT || bt == VT_DOUBLE); - if (bt == VT_FUNC) /* XXX should be done in generic code */ + if (bt == VT_PTR || bt == VT_FUNC) /* XXX should be done in generic code */ size = PTR_SIZE; func3 = size == 1 ? 0 : size == 2 ? 1 : size == 4 ? 2 : 3; if (size < 4 && !is_float(sv->type.t) && (sv->type.t & VT_UNSIGNED))