updated the kernel class initialization to set the superclass
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-07-29 15:36:07 +09:00
parent e4a26b71be
commit 7252ee5e47
4 changed files with 234 additions and 8 deletions

View File

@ -1468,6 +1468,7 @@ static int ignite_1 (hcl_t* hcl)
HCL_OBJ_SET_CLASS (hcl->c_class, (hcl_oop_t)hcl->c_class);
}
/* create class objects except Class */
for (i = 0; i < HCL_COUNTOF(kernel_classes); i++)
{
hcl_oop_class_t tmp;
@ -1496,6 +1497,20 @@ static int ignite_1 (hcl_t* hcl)
*(hcl_oop_class_t*)((hcl_uint8_t*)hcl + kernel_classes[i].offset) = tmp;
}
/* update the superclass field */
for (i = 0; i < HCL_COUNTOF(kernel_classes); i++)
{
int skci;
skci = kernel_classes[i].superclass_kci;
if (skci >= 0)
{
hcl_oop_class_t* x, * y;
x = (hcl_oop_class_t*)((hcl_uint8_t*)hcl + kernel_classes[i].offset);
y = (hcl_oop_class_t*)((hcl_uint8_t*)hcl + kernel_classes[skci].offset);
(*x)->superclass = (hcl_oop_t)*y;
}
}
#if 0
/* an instance of a method class stores byte codes in the trailer space.
* unlike other classes with trailer size set, the size of the trailer