re PR libgcj/27294 (gij throws NullPointerException, when the interpreter is not enabled)

PR libgcj/27294:
	* java/lang/natVMClassLoader.cc (defineClass): Throw
	VirtualMachineError if no interpreter configured.

From-SVN: r113554
This commit is contained in:
Tom Tromey 2006-05-05 15:05:20 +00:00 committed by Tom Tromey
parent c6ea4dd7ae
commit 6ec13f0b96
2 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-05-05 Tom Tromey <tromey@redhat.com>
PR libgcj/27294:
* java/lang/natVMClassLoader.cc (defineClass): Throw
VirtualMachineError if no interpreter configured.
2006-05-03 Andrew Haley <aph@redhat.com>
PR libgcj/27352

View File

@ -1,6 +1,6 @@
// natVMClassLoader.cc - VMClassLoader native methods
/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
This file is part of libgcj.
@ -34,6 +34,7 @@ details. */
#include <java/lang/StringBuffer.h>
#include <java/lang/Runtime.h>
#include <java/util/HashSet.h>
#include <java/lang/VirtualMachineError.h>
java::lang::Class *
java::lang::VMClassLoader::defineClass (java::lang::ClassLoader *loader,
@ -94,6 +95,20 @@ java::lang::VMClassLoader::defineClass (java::lang::ClassLoader *loader,
}
#endif // INTERPRETER
if (! klass)
{
StringBuffer *sb = new StringBuffer();
if (name)
{
sb->append(JvNewStringLatin1("found class file for class "));
sb->append(name);
}
else
sb->append(JvNewStringLatin1("found unnamed class file"));
sb->append(JvNewStringLatin1(", but no interpreter configured in this libgcj"));
throw new VirtualMachineError(sb->toString());
}
return klass;
}