]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (type_assertion_hash): Hash type uids rather than tree pointers.
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 26 Nov 2007 06:27:47 +0000 (06:27 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Mon, 26 Nov 2007 06:27:47 +0000 (06:27 +0000)
* expr.c (type_assertion_hash): Hash type uids rather than
tree pointers.

From-SVN: r130426

gcc/java/ChangeLog
gcc/java/expr.c

index 852028afc14d3e56775886109117269e12a21a31..6cac0b8a77c92a96ac46ae2a48e185686074435a 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-26  Alexandre Oliva  <aoliva@redhat.com>
+
+       * expr.c (type_assertion_hash): Hash type uids rather than
+       tree pointers.
+
 2007-11-17  David Daney  <ddaney@avtrex.com>
            Andrew Haley  <aph@redhat.com>
 
index 1eceaad8bc125f03786a910e4446100730d4969b..8311fbcdee8a354ac1528f2bf906cc79fca59eba 100644 (file)
@@ -433,8 +433,27 @@ type_assertion_hash (const void *p)
   const type_assertion *k_p = p;
   hashval_t hash = iterative_hash (&k_p->assertion_code, sizeof
                                   k_p->assertion_code, 0);
-  hash = iterative_hash (&k_p->op1, sizeof k_p->op1, hash);
-  return iterative_hash (&k_p->op2, sizeof k_p->op2, hash);
+
+  switch (k_p->assertion_code)
+    {
+    case JV_ASSERT_TYPES_COMPATIBLE:
+      hash = iterative_hash (&TYPE_UID (k_p->op2), sizeof TYPE_UID (k_p->op2),
+                            hash);
+      /* Fall through.  */
+
+    case JV_ASSERT_IS_INSTANTIABLE:
+      hash = iterative_hash (&TYPE_UID (k_p->op1), sizeof TYPE_UID (k_p->op1),
+                            hash);
+      /* Fall through.  */
+
+    case JV_ASSERT_END_OF_TABLE:
+      break;
+
+    default:
+      gcc_unreachable ();
+    }
+
+  return hash;
 }
 
 /* Add an entry to the type assertion table for the given class.