[MLton] Marshalling bug in socket options/ioctl/... (Patch included)

Anders Petersson demitar at worldforge.org
Sat Jul 7 04:59:34 PDT 2007


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

(Resending due to some icky mail issues, hope it won't cause a duplicate.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad
	meddelandedel
Url : http://mlton.org/pipermail/mlton/attachments/20070707/675168be/attachment.pgp


More information about the MLton mailing list