Skip to content

Commit

Permalink
Address of solved for riscv64
Browse files Browse the repository at this point in the history
A character size load was used instead of pointer size some times.
  • Loading branch information
hermantb committed Jun 1, 2024
1 parent da5aa7d commit 8cd21e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion riscv64-gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 8cd21e9

Please sign in to comment.