aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/verify-glue.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-02-19 01:14:17 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-02-19 01:14:17 +0000
commit1870a43b3e9ab55bc5b29284c64be32d08989bf3 (patch)
tree70744c5a070902162b614e77d6868d603b6be97f /gcc/java/verify-glue.c
parent4c334b377cb494b44fabd5f5263d53863f051748 (diff)
downloadgcc-1870a43b3e9ab55bc5b29284c64be32d08989bf3.zip
gcc-1870a43b3e9ab55bc5b29284c64be32d08989bf3.tar.gz
gcc-1870a43b3e9ab55bc5b29284c64be32d08989bf3.tar.bz2
re PR java/20056 ('verification failed: incompatible type on stack' with --indirect-dispatch)
PR java/20056: * verify-glue.c (vfy_class_has_field): New function. * verify.h (vfy_class_has_field): Declare. * verify-impl.c (check_field_constant): Added 'putfield' argument. (verify_instructions_0): Updated. (types_equal): New function. From-SVN: r95258
Diffstat (limited to 'gcc/java/verify-glue.c')
-rw-r--r--gcc/java/verify-glue.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/java/verify-glue.c b/gcc/java/verify-glue.c
index b2cd915..5d480e8 100644
--- a/gcc/java/verify-glue.c
+++ b/gcc/java/verify-glue.c
@@ -1,5 +1,5 @@
/* Glue to interface gcj with bytecode verifier.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -385,6 +385,21 @@ vfy_null_type (void)
return TYPE_NULL;
}
+bool
+vfy_class_has_field (vfy_jclass klass, vfy_string name,
+ vfy_string signature)
+{
+ tree field = TYPE_FIELDS (klass);
+ while (field != NULL_TREE)
+ {
+ if (DECL_NAME (field) == name
+ && build_java_signature (TREE_TYPE (field)) == signature)
+ return true;
+ field = TREE_CHAIN (field);
+ }
+ return false;
+}
+
int
vfy_fail (const char *message, int pc, vfy_jclass ignore1 ATTRIBUTE_UNUSED,
vfy_method *ignore2 ATTRIBUTE_UNUSED)