From e7f97f42a13d9da89fc4a0fc1c410448b6fe010b Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 10 May 2023 16:10:53 +0100 Subject: [PATCH] Fix `load()` error caused by #1777 fix (fix #2366) --- src/jsvar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jsvar.c b/src/jsvar.c index 2a98800293..05a304aefc 100644 --- a/src/jsvar.c +++ b/src/jsvar.c @@ -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) @@ -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);