diff options
author | Tom Tromey <tromey@redhat.com> | 2005-04-05 22:26:26 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-04-05 22:26:26 +0000 |
commit | 8b6e76905300f33b868a3619d416cc9285cbfee1 (patch) | |
tree | 2e7ab5655ae0f92acaf1825446f2fec39bb2a56e /libjava/link.cc | |
parent | 13148dd26aafe25ef31d5303f6383d464cc8db61 (diff) | |
download | gcc-8b6e76905300f33b868a3619d416cc9285cbfee1.tar.gz |
jni.cc (_Jv_JNI_GetAnyFieldID): Throw ClassNotFoundException.
* 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.
From-SVN: r97660
Diffstat (limited to 'libjava/link.cc')
-rw-r--r-- | libjava/link.cc | 9 |
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, |