natClassLoader.cc (_Jv_UnregisterClass): Handle case where class' name is NULL.

* java/lang/natClassLoader.cc (_Jv_UnregisterClass): Handle case
	where class' name is NULL.
	(_Jv_FindClass): Don't wait for class state.
	* java/lang/natVMClassLoader.cc (defineClass): Only unregister if
	name found.
	* include/java-interp.h (_Jv_DefineClass): Updated.
	* defineclass.cc (_Jv_DefineClass): Added 'name_result' argument.
	(struct _Jv_ClassReader): Likewise.
	(found_name): New field.
	(handleClassBegin): Set *found_name.
	(_Jv_VerifyMethodSignature): Handle case where ptr==NULL.
	(handleClassBegin): Throw error if super class not set.
	(read_methods): Correctly call check_tag and prepare_pool_entry.

From-SVN: r101301
This commit is contained in:
Tom Tromey 2005-06-24 22:48:33 +00:00 committed by Tom Tromey
parent b7938f087d
commit 42c5169549
5 changed files with 53 additions and 22 deletions

View file

@ -107,6 +107,10 @@ _Jv_FindClassInCache (_Jv_Utf8Const *name)
void
_Jv_UnregisterClass (jclass the_class)
{
// This can happen if the class could not be defined properly.
if (! the_class->name)
return;
JvSynchronize sync (&java::lang::Class::class$);
jint hash = HASH_UTF(the_class->name);
@ -328,12 +332,6 @@ _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader)
}
}
}
else
{
// We need classes to be in the hash while we're loading, so
// that they can refer to themselves.
_Jv_Linker::wait_for_state (klass, JV_STATE_LOADED);
}
return klass;
}