MLton segfault on Linux!

Anoq of the Sun anoq@HardcoreProcessing.com
Tue, 22 May 2001 23:02:09 +0200



"Stephen Weeks" wrote:
> I think your bug is one that was fixed on 1999-8-13, and has been fixed in all
> versions of MLton since then.  The problem is in the
> MLTON_allocArrayNoPointers macro in mlton-lib.h.  Replace it with the following
> to see if this corrects the problem.  Let us know if this works.
> 
> #define MLTON_allocArrayNoPointers(dst,numElts,bytesPerElt)                     \
>                 *(word*)frontier = (numElts);                                   \
>                 *(word*)(frontier + WORD_SIZE) =                                \
>                         GC_arrayHeader((bytesPerElt), 0);                       \
>                 (dst) = frontier + 2 * WORD_SIZE;                               \
>                 frontier = (dst) + ((0 == numElts || 0 == bytesPerElt)          \
>                         ? POINTER_SIZE :                                        \
>                         wordAlign((numElts) * (bytesPerElt)));

Thanks a lot! That helped - it doesn't segfault now :)

And I'm wondering - just below allocArrayNoPointers, there's
a very similar function allocArrayPointers. I see that the
only change to allocArrayNoPointers is that  || 0 == bytesPerElt
is now added. But this is not in the allocArrayPointers
function. So maybe the same should be modified in
allocArrayPointers?


Cheers
-- 
http://www.HardcoreProcessing.com