From 02f463f50abaaa6e8483aeded310ecf94ed930ba Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 11 Mar 2025 00:13:13 +0100 Subject: [PATCH] Make autoinit dispatch table read-only That way it ends up in .rodata instead of .data --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index cb87b50e9..15000285e 100644 --- a/quickjs.c +++ b/quickjs.c @@ -7386,7 +7386,7 @@ int JS_IsInstanceOf(JSContext *ctx, JSValueConst val, JSValueConst obj) /* return the value associated to the autoinit property or an exception */ typedef JSValue JSAutoInitFunc(JSContext *ctx, JSObject *p, JSAtom atom, void *opaque); -static JSAutoInitFunc *js_autoinit_func_table[] = { +static JSAutoInitFunc *const js_autoinit_func_table[] = { js_instantiate_prototype, /* JS_AUTOINIT_ID_PROTOTYPE */ js_module_ns_autoinit, /* JS_AUTOINIT_ID_MODULE_NS */ JS_InstantiateFunctionListItem2, /* JS_AUTOINIT_ID_PROP */