[MLton] Bug in MLton.Pointer on amd64

Matthew Fluet fluet at tti-c.org
Sun Jul 29 13:32:46 PDT 2007


On Sun, 29 Jul 2007, Florian Weimer wrote:
> This program
>
>  val false = MLton.Pointer.sub (MLton.Pointer.null, 0w1)
> 	      = MLton.Pointer.add (MLton.Pointer.null, 0w1)
>
> should run without output, but it raises the Bind exception instead.
> It appears that
>
>  MLton.Pointer.sub (MLton.Pointer.null, 0w1)
>
> is not the all-ones address, but the address 0x1.

Confirmed and fixed:
   http://mlton.org/cgi-bin/viewsvn.cgi?view=rev&rev=5805
Turns out that MLton.Pointer.sub was being assigned the CPointer_add 
primitive, rather than the CPointer_sub primitive.
You can apply the fix directly to 
$(SML_LIB)/basis/primitive/prim-mlton.sml
if you don't feel like recompiling.





More information about the MLton mailing list