[MLton-commit] r5735

Matthew Fluet fluet at mlton.org
Sat Jul 7 08:57:19 PDT 2007


Fixed bug in Socket module of Basis Library; unmarshalling of socket
options (for get* functions) used andb rather than orb.
Thanks to Anders Petersson for the bug report (and patch).


----------------------------------------------------------------------

U   mlton/trunk/basis-library/net/socket.sml
U   mlton/trunk/doc/changelog

----------------------------------------------------------------------

Modified: mlton/trunk/basis-library/net/socket.sml
===================================================================
--- mlton/trunk/basis-library/net/socket.sml	2007-07-07 09:55:54 UTC (rev 5734)
+++ mlton/trunk/basis-library/net/socket.sml	2007-07-07 15:57:18 UTC (rev 5735)
@@ -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)
@@ -149,7 +149,7 @@
                                      else (sizeLen - 1) - i)
                           val w = C_Size.castFromSysWord (Word8.castToSysWord w)
                        in
-                          loop (i + 1, C_Size.andb (w, C_Size.<< (acc, 0w4)))
+                          loop (i + 1, C_Size.orb (w, C_Size.<< (acc, 0w4)))
                        end
          in
             C_Size.toInt (loop (0, 0wx0))
@@ -189,7 +189,7 @@
                                      else (intLen - 1) - i)
                           val w = C_Int.castFromSysWord (Word8.castToSysWord w)
                        in
-                          loopBool (i + 1, C_Int.andb (w, C_Int.<< (acc, 0w4)))
+                          loopBool (i + 1, C_Int.orb (w, C_Int.<< (acc, 0w4)))
                        end
             fun loopInt (i, acc) =
                if i >= intLen
@@ -202,7 +202,7 @@
                                                else (intLen - 1) - i))
                           val w = C_Int.castFromSysWord (Word8.castToSysWord w)
                        in
-                          loopInt (i + 1, C_Int.andb (w, C_Int.<< (acc, 0w4)))
+                          loopInt (i + 1, C_Int.orb (w, C_Int.<< (acc, 0w4)))
                        end
          in
             if loopBool (0, 0) = 0

Modified: mlton/trunk/doc/changelog
===================================================================
--- mlton/trunk/doc/changelog	2007-07-07 09:55:54 UTC (rev 5734)
+++ mlton/trunk/doc/changelog	2007-07-07 15:57:18 UTC (rev 5735)
@@ -1,6 +1,11 @@
 Here are the changes since version 20051202.
 
-* 2007-07-6
+* 2007-07-07
+   - Fixed bug in Socket module of Basis Library; unmarshalling of
+     socket options (for get* functions) used andb rather than orb.
+     Thanks to Anders Petersson for the bug report (and patch).
+
+* 2007-07-06
    - Fixed bug in Date module of Basis Library; some functions would
      erroneously raise Date when given a year <= 1900.  Thanks to Joe
      Hurd for the bug report.




More information about the MLton-commit mailing list