[MLton-devel] cvs commit: fixed shrinker bug

Stephen Weeks sweeks@users.sourceforge.net
Sun, 18 May 2003 17:15:27 -0700


sweeks      03/05/18 17:15:27

  Modified:    doc      changelog
               mlton/atoms prim.fun
  Log:
  Fixed bug in simplifier that could cause the following message
  
    shrinker raised Prim.apply raised assertion failure: SmallIntInf.fromWord
  
  The problem only could have occurred in an SML/NJ-compiled MLton or in
  one where asserts had been turned on.  The bug could conceivably have
  happened if the shrinker visited a piece of dead code where
  SmallIntInf.fromWord got an invalid word (or if there was some other
  more horrible bug caused this in live code).

Revision  Changes    Path
1.34      +2 -0      mlton/doc/changelog

Index: changelog
===================================================================
RCS file: /cvsroot/mlton/mlton/doc/changelog,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- changelog	18 May 2003 23:57:50 -0000	1.33
+++ changelog	19 May 2003 00:15:27 -0000	1.34
@@ -5,6 +5,8 @@
     raise the TypeError exception, along with a lot of XML IL.
     The type-check.sml regression contains simple examples of what
     failed.
+  - Fixed a bug in the simplifier that could cause the message:
+    shrinker raised Prim.apply raised assertion failure: SmallIntInf.fromWord
 
 * 2003-05-15
   - Fixed bug in Real.class introduced on 04-28 that cause many



1.47      +3 -1      mlton/mlton/atoms/prim.fun

Index: prim.fun
===================================================================
RCS file: /cvsroot/mlton/mlton/mlton/atoms/prim.fun,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- prim.fun	18 Apr 2003 22:44:58 -0000	1.46
+++ prim.fun	19 May 2003 00:15:27 -0000	1.47
@@ -854,7 +854,9 @@
 		      | Relation.GREATER => 1)
 	   | (IntInf_equal, [IntInf i1, IntInf i2]) =>
 		bool (IntInf.equals (i1, i2))
-	   | (IntInf_fromWord, [Word w]) => intInf (SmallIntInf.fromWord w)
+	   | (IntInf_fromWord, [Word w]) =>
+		(intInf (SmallIntInf.fromWord w)
+		 handle _ => ApplyResult.Unknown)
 	   | (IntInf_toWord, [IntInf i]) =>
 		(case SmallIntInf.toWord i of
 		    NONE => ApplyResult.Unknown





-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful, 
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel