Skip to content

Commit 391cd3f

Browse files
author
Fabrice Bellard
committed
Fix crash on failure to read bytecode (penneryu)
1 parent 9f6c190 commit 391cd3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

quickjs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34924,7 +34924,8 @@ static void free_function_bytecode(JSRuntime *rt, JSFunctionBytecode *b)
3492434924
JS_AtomGetStrRT(rt, buf, sizeof(buf), b->func_name));
3492534925
}
3492634926
#endif
34927-
free_bytecode_atoms(rt, b->byte_code_buf, b->byte_code_len, TRUE);
34927+
if (b->byte_code_buf)
34928+
free_bytecode_atoms(rt, b->byte_code_buf, b->byte_code_len, TRUE);
3492834929

3492934930
if (b->vardefs) {
3493034931
for(i = 0; i < b->arg_count + b->var_count; i++) {

0 commit comments

Comments
 (0)