[MLton] Marshalling bug in socket options/ioctl/... (Patch
included)
Matthew Fluet
fluet at tti-c.org
Sat Jul 7 09:09:16 PDT 2007
On Sat, 7 Jul 2007, Anders Petersson wrote:
> While debugging some networking code I figured out the problem was the
> following bug in unmarshalInt:
>
> Index: basis-library/net/socket.sml
> ===================================================================
> --- basis-library/net/socket.sml (revision 5727)
> +++ basis-library/net/socket.sml (working copy)
> @@ -105,7 +105,7 @@
> else (intLen - 1) - i)
> val w = C_Int.castFromSysWord (Word8.castToSysWord w)
> in
> - loop (i + 1, C_Int.andb (w, C_Int.<< (acc, 0w4)))
> + loop (i + 1, C_Int.orb (w, C_Int.<< (acc, 0w4)))
> end
> in
> loop (0, 0)
>
> /Anders
Thanks for the bug report and patch. Turns out that the other unmarshal
functions were also using andb rather than orb. I've checked in the fix.
More information about the MLton
mailing list