about summary refs log tree commit diff stats
path: root/lib/monoucha0
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-05-11 18:40:15 +0200
committerbptato <nincsnevem662@gmail.com>2025-05-11 18:40:15 +0200
commitde7ff7388f6882ec2b1def33b25656cb81d7c3cf (patch)
tree5ee290bd919dc2d47dd492b35caf84bc646f10fb /lib/monoucha0
parente7a175c2878f0ae7edf1eca084edd9ff218a3aaf (diff)
downloadchawan-de7ff7388f6882ec2b1def33b25656cb81d7c3cf.tar.gz
quickjs: fix lre_exec without JSContext opaque
Diffstat (limited to 'lib/monoucha0')
-rw-r--r--lib/monoucha0/monoucha/qjs/quickjs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/monoucha0/monoucha/qjs/quickjs.c b/lib/monoucha0/monoucha/qjs/quickjs.c
index 80c492bb..4be0cdb4 100644
--- a/lib/monoucha0/monoucha/qjs/quickjs.c
+++ b/lib/monoucha0/monoucha/qjs/quickjs.c
@@ -45565,16 +45565,21 @@ fail:
 
 bool lre_check_stack_overflow(void *opaque, size_t alloca_size)
 {
-    if (!opaque)
-        return 0;
     JSContext *ctx = opaque;
+
+    if (!ctx)
+        return 0;
     return js_check_stack_overflow(ctx->rt, alloca_size);
 }
 
 int lre_check_timeout(void *opaque)
 {
     JSContext *ctx = opaque;
-    JSRuntime *rt = ctx->rt;
+    JSRuntime *rt;
+
+    if (!ctx)
+      return 0;
+    rt = ctx->rt;
     return (rt->interrupt_handler &&
             rt->interrupt_handler(rt, rt->interrupt_opaque));
 }