Re: pointers < 2^31?

Malcolm Wallace <[email protected]> Wed, 24 Nov 2004 17:35:26 +0000
Newsgroups gmane.comp.lang.haskell.nhc.user
Organization Dept of Computer Science, University of York
Message-ID <[email protected]>
> Am I confused or does nhc98 assume that all pointers are < 2^31?

It would seem that you are right.  The top bit 0x10000000 is the
ZAP_BIT, used to indicate a black-hole (a value already under
evaluation, useful for detecting infinite loops).

> On m68k malloc is giving me stuff above 0xc0000000 and I get a segfault
> the first time mutator.c:460
>     if(GET_TAG(nodeptr) & VAP_TAG && !CINFO_NEED(GET_CINFO(nodeptr))) {
> is reached.

Yes, by a horrendous series of CPP macros,

    GET_CINFO(p) -> EXT_CINFO(*p) -> EXT_FINFO(*p)
    -> EXT_HADDRESS(*p) -> ~ZAP_BIT & *p

the address is being masked.

Regards,
    Malcolm