[MLton] osx compiles again in x86_64 branch

Matthew Fluet fluet@cs.cornell.edu
Tue, 23 May 2006 22:14:49 -0400 (EDT)


> Anyways, it's definitely the code-path which works around a missing mremap, 
> as I hope I've just demonstrated. So set HAS_REMAP FALSE on linux, and I bet 
> you'll get exactly the same problem. For whatever reason, the stack is 
> pointing into the region which gets freed by the first use in growHeap. I 
> imagine that either you're freeing the wrong heap, or you didn't update the 
> stack pointer to the new heap after the move.

The stack pointer wasn't being updated after the move, because 
translateHeap was being called with a size of 0.  One line fix, once I 
finally figured out what was the problem.  BTW, it is also a bug in HEAD, 
so I'm surprised that mlton-20051109 and mlton-20051202 work without 
problems on platforms with HAS_REMAP false.