[MLton-commit] r4662

Matthew Fluet MLton@mlton.org
Sat, 24 Jun 2006 07:46:46 -0700


Fix bug in deepFlatten
----------------------------------------------------------------------

U   mlton/trunk/doc/changelog
U   mlton/trunk/mlton/atoms/prim.sig
U   mlton/trunk/mlton/ssa/deep-flatten.fun
U   mlton/trunk/mlton/ssa/ref-flatten.fun

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

Modified: mlton/trunk/doc/changelog
===================================================================
--- mlton/trunk/doc/changelog	2006-06-23 23:03:37 UTC (rev 4661)
+++ mlton/trunk/doc/changelog	2006-06-24 14:46:43 UTC (rev 4662)
@@ -1,5 +1,9 @@
 Here are the changes since version 20051202.
 
+* 2006-06-24
+   - Fixed a bug in pass to flatten data structures.  Thanks to Joe Hurd
+     for the bug report.
+	
 * 2006-06-08
   - Fixed a bug in the native codegen's implementation of the C-calling
     convention.

Modified: mlton/trunk/mlton/atoms/prim.sig
===================================================================
--- mlton/trunk/mlton/atoms/prim.sig	2006-06-23 23:03:37 UTC (rev 4661)
+++ mlton/trunk/mlton/atoms/prim.sig	2006-06-24 14:46:43 UTC (rev 4662)
@@ -62,7 +62,7 @@
               *)
              | MLton_bug (* ssa to rssa *)
              | MLton_deserialize (* unused *)
-             | MLton_eq (* codegen *)
+             | MLton_eq (* ssa to rssa *)
              | MLton_equal (* polymorphic equality *)
              | MLton_halt (* ssa to rssa *)
              (* MLton_handlesSignals and MLton_installSignalHandler work together

Modified: mlton/trunk/mlton/ssa/deep-flatten.fun
===================================================================
--- mlton/trunk/mlton/ssa/deep-flatten.fun	2006-06-23 23:03:37 UTC (rev 4661)
+++ mlton/trunk/mlton/ssa/deep-flatten.fun	2006-06-24 14:46:43 UTC (rev 4662)
@@ -668,6 +668,7 @@
                 ; result ())
             fun equal () =
                (Value.unify (arg 0, arg 1)
+                ; Value.dontFlatten (arg 0)
                 ; result ())
          in
             case Prim.name prim of
@@ -909,13 +910,7 @@
                                            end
                                   end
                          end)
-             | PrimApp {args, prim} =>
-                  let
-                     val () = simpleTree ()
-                  in
-                     doit (PrimApp {args = replaceVars args,
-                                    prim = prim})
-                  end
+             | PrimApp {args, prim} => simple ()
              | Select {base, offset} =>
                   (case var of
                       NONE => none ()

Modified: mlton/trunk/mlton/ssa/ref-flatten.fun
===================================================================
--- mlton/trunk/mlton/ssa/ref-flatten.fun	2006-06-23 23:03:37 UTC (rev 4661)
+++ mlton/trunk/mlton/ssa/ref-flatten.fun	2006-06-24 14:46:43 UTC (rev 4662)
@@ -511,7 +511,7 @@
        * r: (t ref) = (t)
        * ... <no uses of r> ...
        * x: (... * (t ref) * ...) = (..., r, ...)
-       * ... <othere assignments to r> ...
+       * ... <other assignments to r> ...
        *
        *)
       datatype z = datatype VarInfo.t