From 3bb839da04fa1d86a49f99132985e7f9edc121d1 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 26 Nov 2007 06:27:47 +0000 Subject: [PATCH] expr.c (type_assertion_hash): Hash type uids rather than tree pointers. * expr.c (type_assertion_hash): Hash type uids rather than tree pointers. From-SVN: r130426 --- gcc/java/ChangeLog | 5 +++++ gcc/java/expr.c | 23 +++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 852028afc14..6cac0b8a77c 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2007-11-26 Alexandre Oliva + + * expr.c (type_assertion_hash): Hash type uids rather than + tree pointers. + 2007-11-17 David Daney Andrew Haley 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. -- 2.30.2