[Vm-dev] CRC fix input

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sat Jul 23 20:44:42 UTC 2022


Greetings,

The src/plugins/ZipPlugin/ZipPlugin.c function 
primitiveUpdateGZipCrc32()
is currently broken on RiscV64.

This is due to a "boxed" 64 bit int, only 32 bits of which is actually 
used here.

The choice I made was to add a definition to
   platforms/Cross/vm/sqMemoryAccess.h

vvv---vvv
/* usqInt32 is a 32 bit unsigned integer on 32 and 64 bit systems */
#define usqInt32 unsigned int
^^^---^^^

And then change the local def in primitiveUpdateGZipCrc32()

vvv---vvv
    usqInt32 crc;
^^^---^^^

[A] This works for arch64/arm64 and riscv64/RV64G in both Cuis and 
Squeak, but I currently lack other systems to test on.

[B] This _one_ variable use is the _only_ place so far that I have found 
with this problem.  If the VMMaker ZipPlugin generated the unsigned 32 
bit int var def directly, sqMemoryAccess.h could remain unchanged.

What is the best way to approach this?

Thanks much,
-KenD




More information about the Vm-dev mailing list