summaryrefslogtreecommitdiff
path: root/libjava/link.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 22:26:26 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 22:26:26 +0000
commitbe7d01ed62d74d9c4b7b53f96bb82c8f109f859e (patch)
tree2e7ab5655ae0f92acaf1825446f2fec39bb2a56e /libjava/link.cc
parent9f587d943d2e682a674b64bb64f0086318dc8eb7 (diff)
downloadgcc-be7d01ed62d74d9c4b7b53f96bb82c8f109f859e.tar.gz
* jni.cc (_Jv_JNI_GetAnyFieldID): Throw ClassNotFoundException.
* java/lang/reflect/natMethod.cc (_Jv_GetTypesFromSignature): Rewrote to use _Jv_FindClassFromSignature. * verify.cc (resolve): throw NoClassDefFoundError. * link.cc (resolve_field): Throw NoClassDefFoundError. (find_field): Likewise. * prims.cc (_Jv_FindClassFromSignature): Removed recursion. Handle error cases. Added 'endp' argument. * include/jvm.h (_Jv_FindClassFromSignature): Updated prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/link.cc')
-rw-r--r--libjava/link.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/libjava/link.cc b/libjava/link.cc
index 909a7b68a0e..176b538d64a 100644
--- a/libjava/link.cc
+++ b/libjava/link.cc
@@ -90,8 +90,11 @@ _Jv_Linker::resolve_field (_Jv_Field *field, java::lang::ClassLoader *loader)
{
if (! field->isResolved ())
{
- _Jv_Utf8Const *sig = (_Jv_Utf8Const*)field->type;
- field->type = _Jv_FindClassFromSignature (sig->chars(), loader);
+ _Jv_Utf8Const *sig = (_Jv_Utf8Const *) field->type;
+ jclass type = _Jv_FindClassFromSignature (sig->chars(), loader);
+ if (type == NULL)
+ throw new java::lang::NoClassDefFoundError(field->name->toString());
+ field->type = type;
field->flags &= ~_Jv_FIELD_UNRESOLVED_FLAG;
}
}
@@ -174,6 +177,8 @@ _Jv_Linker::find_field (jclass klass, jclass owner,
// it cheaper.
jclass field_type = _Jv_FindClassFromSignature (field_type_name->chars(),
klass->loader);
+ if (field_type == NULL)
+ throw new java::lang::NoClassDefFoundError(field_name->toString());
jclass found_class = 0;
_Jv_Field *the_field = find_field_helper (owner, field_name,