Skip to content

Commit

Permalink
Fix #10865, Windows julia segfaulting without sys.dll
Browse files Browse the repository at this point in the history
use LocalFree on Windows instead of free

also test this on appveyor
  • Loading branch information
tkelman committed Apr 18, 2015
1 parent c384fce commit 2949b1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ build_script:

test_script:
- usr\bin\julia -e "versioninfo()"
- copy usr\lib\julia\sys.ji local.ji && usr\bin\julia -J local.ji -e "true" && del local.ji
- cd test && ..\usr\bin\julia runtests.jl all
8 changes: 8 additions & 0 deletions src/dlload.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ static uv_lib_t *jl_load_dynamic_library_(const char *modname, unsigned flags, i
else
snprintf(path, PATHBUF, "%s" PATHSEPSTRING "%s%s", dl_path, modname, ext);
if (handle->errmsg) {
#ifdef _OS_WINDOWS_
LocalFree((void*)handle->errmsg);
#else
free(handle->errmsg);
#endif
handle->errmsg = NULL;
}
error = jl_uv_dlopen(path, handle, flags);
Expand All @@ -137,7 +141,11 @@ static uv_lib_t *jl_load_dynamic_library_(const char *modname, unsigned flags, i
/* try loading from standard library path */
snprintf(path, PATHBUF, "%s%s", modname, ext);
if (handle->errmsg) {
#ifdef _OS_WINDOWS_
LocalFree((void*)handle->errmsg);
#else
free(handle->errmsg);
#endif
handle->errmsg = NULL;
}
error = jl_uv_dlopen(path, handle, flags);
Expand Down

0 comments on commit 2949b1e

Please sign in to comment.