added HCL_EUNDEFVAR

This commit is contained in:
2022-05-05 04:03:56 +00:00
parent c8905fc88e
commit ff089929a9
10 changed files with 114 additions and 15 deletions

View File

@ -583,6 +583,7 @@ void hcl_gc (hcl_t* hcl)
old_nil = hcl->_nil;
/* move _nil and the root object table */
hcl->_undef = hcl_moveoop(hcl, hcl->_undef);
hcl->_nil = hcl_moveoop(hcl, hcl->_nil);
hcl->_true = hcl_moveoop(hcl, hcl->_true);
hcl->_false = hcl_moveoop(hcl, hcl->_false);
@ -766,6 +767,12 @@ int hcl_ignite (hcl_t* hcl, hcl_oow_t heapsize)
if (HCL_UNLIKELY(!hcl->heap)) return -1;
}
if (!hcl->_undef)
{
hcl->_undef = hcl_makeundef(hcl);
if (HCL_UNLIKELY(!hcl->_undef)) return -1;
}
if (!hcl->_nil)
{
hcl->_nil = hcl_makenil(hcl);