updated the kernel class initialization to set the superclass
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
15
lib/gc.c
15
lib/gc.c
@ -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
|
||||
|
Reference in New Issue
Block a user