On Sat, 11 Mar 2023, Mark Cave-Ayland wrote:
According to structures.fs the fields in struct instance are cell size which is 4 bytes on 32-bit systems and 8 bytes on 64-bit systems.
my-unit incorrectly assumes that the fields are always "l" (4 byte) size which causes it to return the wrong value on SPARC64. Fix the issue by updating my-unit to use the cell size to calculate its offsets.
This and the previous patch doing the same look good to me but I don't know enough about it to give a reviewed-by. That would be better done by somebody who knows Forth well. So this message does not help much I guess.
Regards, BALATON Zoltan
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
forth/device/package.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/forth/device/package.fs b/forth/device/package.fs index e0fd2d2..8a28263 100644 --- a/forth/device/package.fs +++ b/forth/device/package.fs @@ -197,8 +197,8 @@ defer find-dev
: my-unit ( -- phys.lo ... phys.hi ) ?my-self >in.my-unit
- my-#acells tuck /l* + swap 0 ?do
- /l - dup l@ swap
- my-#acells tuck /n* + swap 0 ?do
- /n - dup @ swap loop drop ;