From 77b100d5e6786023072921e20b4b5d7f4b61ff22 Mon Sep 17 00:00:00 2001 From: Ben Morris Date: Wed, 25 Sep 2024 13:43:41 -0400 Subject: [PATCH] skip verification of class ID in JS_GetOpaque if class_id is 0 --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index 642ae34..e0d3262 100644 --- a/quickjs.c +++ b/quickjs.c @@ -9847,7 +9847,7 @@ void *JS_GetOpaque(JSValueConst obj, JSClassID class_id) if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT) return NULL; p = JS_VALUE_GET_OBJ(obj); - if (p->class_id != class_id) + if (class_id && p->class_id != class_id) return NULL; return p->u.opaque; }