[MLton-commit] r6730

Matthew Fluet fluet at mlton.org
Tue Aug 19 15:11:51 PDT 2008


Take element size from WordXVector; don't default to Word8.
----------------------------------------------------------------------

U   mlton/trunk/mlton/ssa/constant-propagation.fun

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

Modified: mlton/trunk/mlton/ssa/constant-propagation.fun
===================================================================
--- mlton/trunk/mlton/ssa/constant-propagation.fun	2008-08-19 22:11:44 UTC (rev 6729)
+++ mlton/trunk/mlton/ssa/constant-propagation.fun	2008-08-19 22:11:50 UTC (rev 6730)
@@ -1,4 +1,4 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -478,16 +478,17 @@
                   Sconst.WordVector v => v
                 | _ => Error.bug err 
             val length = WordXVector.length v
+            val eltTy = Type.word (WordXVector.elementSize v)
             val elt =
                if 0 = length
-                  then const' (Const.unknown (), Type.word8)
+                  then const' (Const.unknown (), eltTy)
                else let
                        val w = WordXVector.sub (v, 0)
                     in
                        if WordXVector.forall (v, fn w' =>
                                               WordX.equals (w, w'))
                           then const (Sconst.word w)
-                       else const' (Const.unknown (), Type.word8)
+                       else const' (Const.unknown (), eltTy)
                     end
             val length =
                const (Sconst.Word (WordX.fromIntInf (IntInf.fromInt length,




More information about the MLton-commit mailing list