diff options
author | Andrew Haley <aph@redhat.com> | 2005-04-29 18:35:36 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2005-04-29 18:35:36 +0000 |
commit | f3dc41fe8e21d79b5338eca6fa50e894b6a4db14 (patch) | |
tree | ba9d688326059397b1b085f20d47c6aba292b04f /libjava/prims.cc | |
parent | 528a7d226228804091bbcccca1ee5e97656e0092 (diff) | |
download | gcc-f3dc41fe8e21d79b5338eca6fa50e894b6a4db14.tar.gz |
re PR java/19285 (Interfaces not initialized by static field access)
2005-04-27 Andrew Haley <aph@redhat.com>
PR java/19285
* prims.cc (_Jv_ResolvePoolEntry): New function.
* include/jvm.h (_Jv_Linker::find_field): New arg: found_class.
* link.cc (_Jv_Linker::find_field): New arg: found_class.
(resolve_pool_entry): Initialize the class in which a field is
found.
(link_symbol_table): Pass new arg to found_class.
From-SVN: r99006
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index b62514581dd..98d30232451 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -359,6 +359,22 @@ _Jv_ThrowNullPointerException () throw new java::lang::NullPointerException; } +// Resolve an entry in the constant pool and return the target +// address. +void * +_Jv_ResolvePoolEntry (jclass this_class, jint index) +{ + _Jv_Constants *pool = &this_class->constants; + + if ((pool->tags[index] & JV_CONSTANT_ResolvedFlag) != 0) + return pool->data[index].field->u.addr; + + JvSynchronize sync (this_class); + return (_Jv_Linker::resolve_pool_entry (this_class, index)) + .field->u.addr; +} + + // Explicitly throw a no memory exception. // The collector calls this when it encounters an out-of-memory condition. void _Jv_ThrowNoMemory() |