[Vm-dev] patch for subversion (classical VM) primitiveLocalMicroseconds

stes@PANDORA.BE stes at telenet.be
Thu Apr 22 16:22:20 UTC 2021


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Hi,

Is it please possible to add (to subversion SVN repo) the patch for 
time_t arithmetic in primitiveLocalMicrosecondClock.  See patch in attach.

Basically there is a bug with arithmetic on "signed long" (time_t).
I think it is meant to be arithmetic (multiplication) on "signed long long".

Note that for me the 64bit VM is NOT affected by this bug.

$ cc -m32 sizeoftime.c 
$ ./a.out
sizeof time_t is 4
sizeof long is 4
sizeof long long is 8

$ cc -m64 sizeoftime.c 
$ ./a.out
sizeof time_t is 8
sizeof long is 8
sizeof long long is 8

The problem on the 32bit VM is for me that primitiveLocalMicrosecondClock,
is trying to assign to a sqLong (long long) but it is first doing arithmetic
on the long type (which causes overflow).

David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJggaI7AAoJENdFDkXGicizjosH/jHA/28NE/jKuuo3gZQYZeLQ
Auhb/gWP8xSVDFCEJvMEvH7x+p8LhqDNWxk/F/pKgdQypnu2i/cwTHYJTLr0Knk/
mFqoNrPCk2n6Z4fFBf2YX5JyDZ9ifPO3tb+vOStypR9bf3IP5o0cmLH2JAoQ22hp
y3uZSe12JBZ6yMu3JTxrsWOZPV3rKVIeupSeA9cK7k7IL50iFOYYD+an3xqfzHVz
6ByE7VeWuTbLFdKuANndqR+xdv4ZMgmn2/EB2consfYHI5o4RRXlWhTqgvevlLNG
0ubFpKG39u26Fy+ACjD3O3e5JkiJe2U3TgvBkC3nUpxqga78ZN8IROOa+qHyEUs=
=D7S9
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: primitiveLocalMicrosecondClock.patch
Type: text/x-patch
Size: 615 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20210422/8cf9e6b3/attachment.bin>


More information about the Vm-dev mailing list