Fix crash on failure to read bytecode (arguments, local variables, etc.)

This commit is contained in:
Penner 2025-08-29 16:35:54 +08:00
parent 20d2b404af
commit 095bd0b4ab

View File

@ -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++) {