Skip to content

Commit

Permalink
Fix load() error caused by #1777 fix (fix #2366)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed May 10, 2023
1 parent a3da8f7 commit e7f97f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/jsvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ static JsVarRef jsvInitJsVars(JsVarRef start, unsigned int count) {

void jsvInit(unsigned int size) {
#ifdef RESIZABLE_JSVARS
assert(size==0);
// ignore size here - we're always going to start off at our smallest size
NOT_USED(size);
jsVarsSize = JSVAR_BLOCK_SIZE;
jsVarBlocks = malloc(sizeof(JsVar*)); // just 1
#if defined(ESPR_JIT) && defined(LINUX)
Expand All @@ -343,7 +344,7 @@ void jsvInit(unsigned int size) {
if(!jsVars) jsVars = (JsVar *)malloc(sizeof(JsVar) * jsVarsSize);
#endif
#else
assert(size==0);
assert(size==JSVAR_CACHE_SIZE);
#endif

jsVarFirstEmpty = jsvInitJsVars(1/*first*/, jsVarsSize);
Expand Down

0 comments on commit e7f97f4

Please sign in to comment.