Skip to content

Commit

Permalink
fix(dynamiclib): invalid function pointer to data pointer conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
takase1121 authored and euclidianAce committed Aug 11, 2023
1 parent 2fee195 commit 0c63020
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion csrc/dynamiclib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0c63020

Please sign in to comment.