From 0c63020d861b6a3cfa5ff9a756a512b3efc533a3 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:19:11 +0800 Subject: [PATCH] fix(dynamiclib): invalid function pointer to data pointer conversion --- csrc/dynamiclib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csrc/dynamiclib.c b/csrc/dynamiclib.c index 4d4464b..e82db03 100644 --- a/csrc/dynamiclib.c +++ b/csrc/dynamiclib.c @@ -18,7 +18,8 @@ bool ltreesitter_open_dynamic_lib(const char *name, ltreesitter_Dynlib **handle) void *ltreesitter_dynamic_sym(ltreesitter_Dynlib *handle, const char *sym_name) { #ifdef _WIN32 - return GetProcAddress(handle, sym_name); + FARPROC sym = GetProcAddress(handle, sym_name); + return *(void**)(&sym); #elif LTREESITTER_USE_LIBUV void *sym = NULL; if (uv_dlsym(handle, sym_name, &sym) == 0) {