[svn] r7075: nemerle/trunk/ncc/typing/DecisionTreeBuilder.n

malekith svnadmin at nemerle.org
Sat Dec 9 21:58:34 CET 2006


Log:
Prevent OverflowExn in matching compiler. Patch by Evin Robertson.

Author: malekith
Date: Sat Dec  9 21:58:33 2006
New Revision: 7075

Modified:
   nemerle/trunk/ncc/typing/DecisionTreeBuilder.n

Modified: nemerle/trunk/ncc/typing/DecisionTreeBuilder.n
==============================================================================
--- nemerle/trunk/ncc/typing/DecisionTreeBuilder.n	(original)
+++ nemerle/trunk/ncc/typing/DecisionTreeBuilder.n	Sat Dec  9 21:58:33 2006
@@ -432,7 +432,7 @@
         match (this)
         {
           | Here => 0
-          | Field (f, p) => f.GetHashCode () + p.GetHashCode ()
+          | Field (f, p) => unchecked ( f.GetHashCode () + p.GetHashCode () )
         }
       }
     }
@@ -527,7 +527,7 @@
 
       public override GetHashCode () : int
       {
-        match (this) {
+        unchecked match (this) {
           | IfEq (path, con, _, _) => path.GetHashCode () + con.GetHashCode ()
           | Assign (path, decl, _) => path.GetHashCode () + decl.GetHashCode ()
           | Success (res_id) => 1 + res_id



More information about the svn mailing list