about summary refs log tree commit diff stats
path: root/lib/quickjs/quickjs.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2023-12-22 11:03:44 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-22 15:05:54 +0100
commit140995dcac79e7fafaae52f56a31cdf7f7074fde (patch)
tree079ac605b498683dc8080aab033fd691eedd0745 /lib/quickjs/quickjs.c
parent4c5bcfbac974718732ca9ab6729178c8a08c4cf3 (diff)
downloadchawan-140995dcac79e7fafaae52f56a31cdf7f7074fde.tar.gz
added container_of macro
Diffstat (limited to 'lib/quickjs/quickjs.c')
-rw-r--r--lib/quickjs/quickjs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c
index 8f348e7e..a9e89211 100644
--- a/lib/quickjs/quickjs.c
+++ b/lib/quickjs/quickjs.c
@@ -4088,7 +4088,7 @@ void JS_FreeCString(JSContext *ctx, const char *ptr)
     if (!ptr)
         return;
     /* purposely removing constness */
-    p = (JSString *)(void *)(ptr - offsetof(JSString, u));
+    p = container_of(ptr, JSString, u);
     JS_FreeValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
 }