[M3commit] CVS Update: cm3
Tony Hosking
hosking at cs.purdue.edu
Wed Feb 10 16:18:24 CET 2010
Jay, I think your usage of TInt and TWord is strongly at odds with its intended use. Certainly, allowing TInt.Add/Subtract to overflow will break large swaths of the front-end. There is a deep contract there that requires that TInt arithmetic not provide bogus results.
Antony Hosking | Associate Professor | Computer Science | Purdue University
305 N. University Street | West Lafayette | IN 47907 | USA
Office +1 765 494 6001 | Mobile +1 765 427 5484
On 10 Feb 2010, at 12:58, Jay Krell wrote:
> CVSROOT: /usr/cvs
> Changes by: jkrell at birch. 10/02/10 12:58:11
>
> Modified files:
> cm3/m3-sys/m3back/src/: Stackx86.m3
>
> Log message:
> allow negating FIRST(INTEGER) even though it overflows
> allows this test case to compile:
> C:\dev2\cm3.2\m3-sys\m3tests\src\p1\p137>cm3
> --- building in NT386 ---
>
> new source -> compiling Main.m3
> "..\Main.m3", line 35: doneg: Negate overflowed
> 1 error encountered
> compilation failed => not building program "pgm.exe"
> Fatal Error: package build failed
>
> tempting to make TInt.Add/Subtract return the value
> even if overflow, but for now, no.
> This fix assumes two's complement, that is,
> it assumes FIRST(INTEGER) = -FIRST(INTEGER)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3commit/attachments/20100210/a42e5179/attachment-0002.html>
More information about the M3commit
mailing list