implementing instance variable access with regards to inheritance

This commit is contained in:
2022-02-06 16:06:48 +00:00
parent eac89bff5c
commit ef24bf68df
4 changed files with 45 additions and 19 deletions

View File

@ -368,6 +368,17 @@ hcl_oop_t hcl_makeclass (hcl_t* hcl, hcl_oop_t superclass, hcl_ooi_t nivars, hcl
c->nivars = HCL_SMOOI_TO_OOP(nivars);
c->ncvars = HCL_SMOOI_TO_OOP(ncvars);
if ((hcl_oop_t)superclass != hcl->_nil)
{
hcl_ooi_t nivars_super;
nivars_super = HCL_OOP_TO_SMOOI(((hcl_oop_class_t)superclass)->nivars_super) + HCL_OOP_TO_SMOOI(((hcl_oop_class_t)superclass)->nivars);
c->nivars_super = HCL_SMOOI_TO_OOP(nivars_super);
}
else
{
c->nivars_super = HCL_SMOOI_TO_OOP(0);
}
return (hcl_oop_t)c;
}