- Calling the class loader
- Running the main method
- $Id: main.c 1481 2004-11-11 14:37:23Z twisti $
+ $Id: main.c 1505 2004-11-14 14:15:58Z jowenn $
*/
if (startit) {
methodinfo *mainmethod;
- java_objectarray *a;
+ java_objectarray *a;
+ s4 result=0;
/* create, load and link the main class */
mainclass = class_new(utf_new_char(mainstring));
asm_calljavafunction(mainmethod, a, NULL, NULL, NULL);
/* exception occurred? */
- if (*exceptionptr)
+ if (*exceptionptr) {
+ result=1;
throw_main_exception();
+ }
#if defined(USE_THREADS)
#if defined(NATIVE_THREADS)
/* now exit the JavaVM */
- cacao_exit(0);
+ cacao_exit(result);
}
/************* If requested, compile all methods ********************/
if (!m)
throw_main_exception_exit();
- asm_calljavafunction(m, rt, (void *) 0, NULL, NULL);
+ asm_calljavafunction(m, rt, (void *) status, NULL, NULL);
/* this should never happen */