> You're casting a large int into a small int and this seems right.
> Just as (uchar)0x1234 => 0x34
>
> > marshalling a 64-bit pointer in this way will lay down the
> > bytes with the hi and lo reversed.
>
> Perhaps you meant to do *(uchar*)&x?
you're right. what was i thinking. still, pointers are marshaled wrong.
compiled on mips, this program
#include <u.h>
#include <libc.h>
void
main(void)
{
char *p;
p = malloc(100);
print("%p\n", p);
}
does this
; 6.crash
6.crash 203443: suicide: sys: trap: #SS pc=0x2048f2
- erik