From bd86598ed7b4aab9c8bf18f2a13f3ccf21552329 Mon Sep 17 00:00:00 2001 From: Penner Date: Fri, 29 Aug 2025 16:18:25 +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 378967211..c56790d86 100644 --- a/quickjs.c +++ b/quickjs.c @@ -34077,7 +34077,8 @@ static void free_function_bytecode(JSRuntime *rt, JSFunctionBytecode *b) { int i; - 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++) {