When translating peek2u, the type inference is ends up looking like:
/** while peek2u(ptr) do*/
L1:
if (IS_ATOM_INT(_ptr_1518)) {
_735 = *(unsigned short *)_ptr_1518;
}
else {
_735 = NewString((char *)(unsigned long)(DBL_PTR(_ptr_1518)->dbl));
}
It's not detecting the possibility of an atom being used as a pointer. This probably applies to other peeks, since I think a lot of the code is shared.
The translator was only testing for PEEK2S, not PEEK2U and PEEK2S.