Skip to content

Commit 17757b3

Browse files
mochaaPsaghul
andcommitted
quickjs-libc: cast opaque pointer to JSRuntime* in js_std_dbuf_init, suppress clang sanitize warnings
Co-authored-by: Saúl Ibarra Corretgé <[email protected]>
1 parent 8e671eb commit 17757b3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

quickjs-libc.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,15 @@ typedef struct JSThreadState {
172172

173173
static uint64_t os_pending_signals;
174174

175+
static void *js_std_dbuf_realloc(void *opaque, void *ptr, size_t size)
176+
{
177+
JSRuntime *rt = opaque;
178+
return js_realloc_rt(rt, ptr, size);
179+
}
180+
175181
static void js_std_dbuf_init(JSContext *ctx, DynBuf *s)
176182
{
177-
dbuf_init2(s, JS_GetRuntime(ctx), (DynBufReallocFunc *)js_realloc_rt);
183+
dbuf_init2(s, JS_GetRuntime(ctx), js_std_dbuf_realloc);
178184
}
179185

180186
static bool my_isdigit(int c)

0 commit comments

Comments
 (0)