From: Michael Starzinger Date: Wed, 25 Feb 2009 08:38:31 +0000 (+0100) Subject: * src/native/vm/nativevm.cpp (nativevm_init): Return boolean to indicate error. X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=cacao.git;a=commitdiff_plain;h=470fc741793d610b57b00c7f636ecacd3ed23c4a * src/native/vm/nativevm.cpp (nativevm_init): Return boolean to indicate error. * src/native/vm/nativevm.hpp (nativevm_init): Adapted signature accordignly. * src/vm/vm.cpp (VM::VM): Check for above error flag. --- diff --git a/src/native/vm/nativevm.cpp b/src/native/vm/nativevm.cpp index 675bacb85..837b4a0b7 100644 --- a/src/native/vm/nativevm.cpp +++ b/src/native/vm/nativevm.cpp @@ -30,6 +30,7 @@ #include "native/vm/nativevm.hpp" #include "vm/class.hpp" +#include "vm/exceptions.hpp" #include "vm/initialize.hpp" #include "vm/method.hpp" #include "vm/options.h" @@ -161,7 +162,7 @@ void nativevm_preinit(void) *******************************************************************************/ -void nativevm_init(void) +bool nativevm_init(void) { TRACESUBSYSTEMINITIALIZATION("nativevm_init"); @@ -180,10 +181,13 @@ void nativevm_init(void) false); if (m == NULL) - os::abort("nativevm_init: Error resolving java.lang.System.initializeSystemClass()"); + return false; (void) vm_call_method(m, NULL); + if (exceptions_get_exception() != NULL) + return false; + # else # error unknown classpath configuration # endif @@ -195,6 +199,8 @@ void nativevm_init(void) #else # error unknown Java configuration #endif + + return true; } diff --git a/src/native/vm/nativevm.hpp b/src/native/vm/nativevm.hpp index 826643f61..9f651a6ce 100644 --- a/src/native/vm/nativevm.hpp +++ b/src/native/vm/nativevm.hpp @@ -31,7 +31,7 @@ /* function prototypes ********************************************************/ void nativevm_preinit(void); -void nativevm_init(void); +bool nativevm_init(void); #if defined(ENABLE_JAVASE) # if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH) diff --git a/src/vm/vm.cpp b/src/vm/vm.cpp index 43fb31c9a..349ab9a3b 100644 --- a/src/vm/vm.cpp +++ b/src/vm/vm.cpp @@ -1472,7 +1472,8 @@ VM::VM(JavaVMInitArgs* vm_args) /* Initialize the native VM subsystem. */ /* AFTER: threads_init (at least for SUN's classes) */ - nativevm_init(); + if (!nativevm_init()) + os::abort("vm_create: nativevm_init failed"); #if defined(ENABLE_PROFILING) /* initialize profiling */