summaryrefslogtreecommitdiff
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-26 06:27:47 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-26 06:27:47 +0000
commite017c7d38783cc4078aa26418224360aba1e60a8 (patch)
tree7bd011f79e3061ed3f901e9b202a813fc922834b /gcc/java/expr.c
parent7a07cc13f827f11fb6955fda7af478aab2c39290 (diff)
downloadgcc-e017c7d38783cc4078aa26418224360aba1e60a8.tar.gz
* expr.c (type_assertion_hash): Hash type uids rather than
tree pointers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130426 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 1eceaad8bc1..8311fbcdee8 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -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.