Add recommended workaround for dlsym void* return cast

This commit is contained in:
Andrew Johnson 2024-07-01 16:12:09 +03:00 committed by Charlie Gordon
parent 1aa0020cce
commit a959457309

View file

@ -517,7 +517,7 @@ static JSModuleDef *js_module_loader_so(JSContext *ctx,
goto fail;
}
init = (JSInitModuleFunc *)dlsym(hd, "js_init_module");
*(void **) (&init) = dlsym(hd, "js_init_module");
if (!init) {
JS_ThrowReferenceError(ctx, "could not load module filename '%s': js_init_module not found",
module_name);