Fix crash on failure to read bytecode (penneryu)

This commit is contained in:
Fabrice Bellard 2025-09-13 10:22:24 +02:00
parent 9f6c190731
commit 391cd3feff

View File

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