Ignore errors when loading a class for the JIT compiler.
[INTERPRETER] * BUG: Ignore errors when loading a class for the JIT compiler. [GB.JIT] * BUG: Loading a class during JIT compilation can fail. Take that into account.
This commit is contained in:
parent
a1d9ffc57d
commit
ce37d6ff67
4 changed files with 19 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue