diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-26 15:41:46 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-26 15:41:46 +0000 |
commit | b8bc917a46b2bf532a7108ed9441a2027469baed (patch) | |
tree | 88690a510261c7f1c3fc40c4ca51027140d15d66 /gcc/java | |
parent | efea8179a3a55cb7719ff156ca3bad1789dba86f (diff) | |
download | gcc-b8bc917a46b2bf532a7108ed9441a2027469baed.tar.gz |
* expr.c (java_push_constant_from_pool): Handle 'ldc class'.
* verify-glue.c (vfy_class_type): New function.
* verify-impl.c (check_constant): Allow 'ldc class'.
* verify.h (vfy_class_type): Declare.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114135 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/java/expr.c | 6 | ||||
-rw-r--r-- | gcc/java/verify-glue.c | 8 | ||||
-rw-r--r-- | gcc/java/verify-impl.c | 4 | ||||
-rw-r--r-- | gcc/java/verify.h | 3 |
5 files changed, 26 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index fa2580fc4e4..edcde22c8e1 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2006-05-26 Tom Tromey <tromey@redhat.com> + + * expr.c (java_push_constant_from_pool): Handle 'ldc class'. + * verify-glue.c (vfy_class_type): New function. + * verify-impl.c (check_constant): Allow 'ldc class'. + * verify.h (vfy_class_type): Declare. + 2006-05-25 Andrew Haley <aph@redhat.com> PR java/27756 diff --git a/gcc/java/expr.c b/gcc/java/expr.c index b2e03fc862e..94f76fdd8c1 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -3117,6 +3117,12 @@ java_push_constant_from_pool (JCF *jcf, int index) c = build_ref_from_constant_pool (index); c = convert (promote_type (string_type_node), c); } + else if (JPOOL_TAG (jcf, index) == CONSTANT_Class + || JPOOL_TAG (jcf, index) == CONSTANT_ResolvedClass) + { + tree record = get_class_constant (jcf, index); + c = build_class_ref (record); + } else c = get_constant (jcf, index); push_value (c); diff --git a/gcc/java/verify-glue.c b/gcc/java/verify-glue.c index 737a19bd770..23fcaba3d40 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, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -329,6 +329,12 @@ vfy_object_type (void) } vfy_jclass +vfy_class_type (void) +{ + return class_type_node; +} + +vfy_jclass vfy_string_type (void) { vfy_jclass k; diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c index f672fcf7881..886dfe7d66c 100644 --- a/gcc/java/verify-impl.c +++ b/gcc/java/verify-impl.c @@ -1975,6 +1975,10 @@ check_constant (int index) init_type_from_tag (&t, int_type); else if (vfy_tag (pool, index) == JV_CONSTANT_Float) init_type_from_tag (&t, float_type); + else if (vfy_tag (pool, index) == JV_CONSTANT_Class + || vfy_tag (pool, index) == JV_CONSTANT_ResolvedClass) + /* FIXME: should only allow this for 1.5 bytecode. */ + init_type_from_class (&t, vfy_class_type ()); else verify_fail_pc ("String, int, or float constant expected", vfr->start_PC); return t; diff --git a/gcc/java/verify.h b/gcc/java/verify.h index d63519379ae..b85176ea85d 100644 --- a/gcc/java/verify.h +++ b/gcc/java/verify.h @@ -1,5 +1,5 @@ /* Declarations to interface gcj with bytecode verifier. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -112,6 +112,7 @@ vfy_jclass vfy_get_component_type (vfy_jclass klass); bool vfy_is_abstract (vfy_jclass klass); vfy_jclass vfy_find_class (vfy_jclass klass, vfy_string name); vfy_jclass vfy_object_type (void); +vfy_jclass vfy_class_type (void); vfy_jclass vfy_string_type (void); vfy_jclass vfy_throwable_type (void); vfy_jclass vfy_unsuitable_type (void); |