]> git.kaiwu.me - quickjs.git/commitdiff
Fix crash on failure to read bytecode (penneryu)
authorFabrice Bellard <fabrice@bellard.org>
Sat, 13 Sep 2025 08:22:24 +0000 (10:22 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Sat, 13 Sep 2025 08:22:24 +0000 (10:22 +0200)
quickjs.c

index 96e8d50cfca7adbdd0bd38fd29d9a36d8b04ea40..00043838afe2569963bd0d004d0c0c3286c3e263 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -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++) {