enhanced error handling in some object allocation functions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-02-25 13:55:03 +09:00
parent ba2e5d1ed6
commit 2bd510181c
4 changed files with 44 additions and 13 deletions

View File

@ -604,6 +604,8 @@ int hcl_unmarshalcodefrommem (hcl_t* hcl, hcl_code_t* code, const hcl_ptl_t* src
int hcl_brewcode (hcl_t* hcl, hcl_code_t* code)
{
/* create space to hold byte code and debug information */
if (!code->bc.ptr)
{
code->bc.ptr = (hcl_oob_t*)hcl_allocmem(hcl, HCL_SIZEOF(*code->bc.ptr) * HCL_BC_BUFFER_INIT); /* TODO: set a proper intial size */