diff --git a/main/gbx/gbx_api.c b/main/gbx/gbx_api.c index bfb59c3bb..debb86d60 100644 --- a/main/gbx/gbx_api.c +++ b/main/gbx/gbx_api.c @@ -362,7 +362,7 @@ const void *const GAMBAS_JitApi[] = (void *)EXEC_enum_next, (void *)SYMBOL_find, (void *)JIT_load_class, - (void *)CLASS_load_without_init, + (void *)JIT_load_class_without_init, (void *)&ERROR_current, (void *)&ERROR_handler, (void *)ERROR_reset, diff --git a/main/gbx/gbx_jit.c b/main/gbx/gbx_jit.c index 673947f90..716f8b47f 100644 --- a/main/gbx/gbx_jit.c +++ b/main/gbx/gbx_jit.c @@ -391,3 +391,16 @@ void JIT_load_class(CLASS *class) { CLASS_load(class); } + +void JIT_load_class_without_init(CLASS *class) +{ + TRY + { + CLASS_load_without_init(class); + } + CATCH + { + class->error = FALSE; + } + END_TRY +} diff --git a/main/gbx/gbx_jit.h b/main/gbx/gbx_jit.h index 5cd1941f2..d7e64aee0 100644 --- a/main/gbx/gbx_jit.h +++ b/main/gbx/gbx_jit.h @@ -54,5 +54,6 @@ void JIT_exit(void); bool JIT_can_compile(ARCHIVE *arch); void JIT_load_class(CLASS *class); +void JIT_load_class_without_init(CLASS *class); #endif diff --git a/main/lib/jit/jit.c b/main/lib/jit/jit.c index a17286583..63e29aac7 100644 --- a/main/lib/jit/jit.c +++ b/main/lib/jit/jit.c @@ -545,7 +545,10 @@ void JIT_load_class_without_init(CLASS *class) int JIT_find_symbol(CLASS *class, const char *name) { JIT_load_class_without_init(class); - return JIT.find_symbol(class->table, class->sort, class->n_desc, sizeof(CLASS_DESC_SYMBOL), TF_IGNORE_CASE, name, strlen(name), NULL); + if (class->loaded) + return JIT.find_symbol(class->table, class->sort, class->n_desc, sizeof(CLASS_DESC_SYMBOL), TF_IGNORE_CASE, name, strlen(name), NULL); + else + return NO_SYMBOL; }