We also need to make sure that the class we load in main() is initialized since we're not using invokestatic to call it.
Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com> --- jit/trampoline.c | 5 ----- vm/jato.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jit/trampoline.c b/jit/trampoline.c index bc1477e..fd840e1 100644 --- a/jit/trampoline.c +++ b/jit/trampoline.c @@ -101,11 +101,6 @@ void *jit_magic_trampoline(struct compilation_unit *cu) if (opt_trace_magic_trampoline) trace_magic_trampoline(cu); - if (vm_class_ensure_init(method->class)) { - NOT_IMPLEMENTED; - return NULL; - } - pthread_mutex_lock(&cu->mutex); if (vm_method_is_native(cu->method)) diff --git a/vm/jato.c b/vm/jato.c index 3a42b62..33d5a6f 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -314,6 +314,11 @@ main(int argc, char *argv[]) goto out; } + if (vm_class_ensure_init(vmc)) { + fprintf(stderr, "error: %s: couldn't initialize\n", classname); + goto out; + } + struct vm_method *vmm = vm_class_get_method_recursive(vmc, "main", "([Ljava/lang/String;)V"); if (!vmm) { -- 1.6.0.4 ------------------------------------------------------------------------------ _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel