From 095bd0b4ab47fdea93162007c0dae1f801160b9d Mon Sep 17 00:00:00 2001 From: Penner Date: Fri, 29 Aug 2025 16:35:54 +0800 Subject: [PATCH] Fix crash on failure to read bytecode (arguments, local variables, etc.) --- quickjs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index b93e282..09d623f 100644 --- a/quickjs.c +++ b/quickjs.c @@ -34952,7 +34952,8 @@ static void free_function_bytecode(JSRuntime *rt, JSFunctionBytecode *b) JS_AtomGetStrRT(rt, buf, sizeof(buf), b->func_name)); } #endif - free_bytecode_atoms(rt, b->byte_code_buf, b->byte_code_len, TRUE); + if (b->byte_code_buf) + free_bytecode_atoms(rt, b->byte_code_buf, b->byte_code_len, TRUE); if (b->vardefs) { for(i = 0; i < b->arg_count + b->var_count; i++) {