updated code to correct the RDONLY bit behavior
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-08 15:52:32 +09:00
parent 4a6da0b386
commit b39bfaa181
14 changed files with 160 additions and 74 deletions

View File

@ -181,6 +181,12 @@ static hcl_pfrc_t __basic_at_put (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs, i
return HCL_PF_FAILURE;
}
if (HCL_OBJ_GET_FLAGS_RDONLY(obj))
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "receiver immutable - %O", obj);
return HCL_PF_FAILURE;
}
if (hcl_inttooow_noseterr(hcl, pos, &index) <= 0)
{
/* negative integer or not integer */
@ -189,9 +195,10 @@ static hcl_pfrc_t __basic_at_put (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs, i
}
_class = (hcl_oop_class_t)HCL_CLASSOF(hcl, obj);
if (span_fixed)
if (span_fixed) /* include the fixed part in positioning */
{
hcl_oow_t size;
size = HCL_OBJ_GET_SIZE(obj);
if (index >= size)
{