[MLton-commit] r4045

Stephen Weeks MLton@mlton.org
Fri, 26 Aug 2005 21:17:35 -0700


Fixed bug that was recently introduced with the change in
implementation of MLton_touch.  The problem was that with -profile
count, MLton_touch is used on an argument of type unit, which has no
representation, and so triggered an unhandled Option exception during
SSA to RSSA translation.  The fix was simply to drop "MLton_touch ()"
when going from SSA to RSSA.


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

U   mlton/trunk/mlton/backend/ssa-to-rssa.fun

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

Modified: mlton/trunk/mlton/backend/ssa-to-rssa.fun
===================================================================
--- mlton/trunk/mlton/backend/ssa-to-rssa.fun	2005-08-27 04:01:21 UTC (rev 4044)
+++ mlton/trunk/mlton/backend/ssa-to-rssa.fun	2005-08-27 04:17:31 UTC (rev 4045)
@@ -1189,7 +1189,10 @@
                                | MLton_size =>
                                     simpleCCall
                                     (CFunction.size (Operand.ty (a 0)))
-                               | MLton_touch => primApp prim
+                               | MLton_touch =>
+                                    if isSome (toRtype (varType (arg 0))) then
+                                       primApp prim
+                                    else none ()
                                | Pointer_getPointer => pointerGet ()
                                | Pointer_getReal _ => pointerGet ()
                                | Pointer_getWord _ => pointerGet ()