[MLton-commit] r5675

Matthew Fluet fluet at mlton.org
Sun Jun 24 17:50:46 PDT 2007


Fixed bug in SSA2 shrinker.  Don't introduce an argument when a case
is simplified by taking a branch that ignores the type refinement.


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

U   mlton/trunk/mlton/ssa/shrink2.fun

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

Modified: mlton/trunk/mlton/ssa/shrink2.fun
===================================================================
--- mlton/trunk/mlton/ssa/shrink2.fun	2007-06-25 00:48:26 UTC (rev 5674)
+++ mlton/trunk/mlton/ssa/shrink2.fun	2007-06-25 00:50:45 UTC (rev 5675)
@@ -997,6 +997,10 @@
                                  val n = Vector.length cases
                                  fun doit (l, args) =
                                     let
+                                       val args =
+                                          if 0 = Vector.length (labelArgs l)
+                                             then Vector.new0 ()
+                                          else args
                                        val m = labelMeaning l
                                        val () = addLabelMeaning m
                                        val () = gone ()
@@ -1040,9 +1044,7 @@
                                              {con = SOME con, ...}) => 
                                           findCase (cases,
                                                     fn c => Con.equals (con, c),
-                                                    if 0 = Vector.length args
-                                                       then Vector.new0 ()
-                                                    else Vector.new1 variant)
+                                                    Vector.new1 variant)
                                      | _ => cantSimplify ()
                                  end
                             | _ => cantSimplify ()




More information about the MLton-commit mailing list