From 52f0cf609ace6b49d2ca39a0d8e010756d61f4a3 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Sat, 18 Apr 2015 02:46:07 -0700 Subject: [PATCH] Fix #10865, Windows julia segfaulting without sys.dll also test this on appveyor --- appveyor.yml | 1 + src/dlload.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 2fc6355564531..556d9b669d576 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/src/dlload.c b/src/dlload.c index 6ea00f039f37e..294db1f68d029 100644 --- a/src/dlload.c +++ b/src/dlload.c @@ -120,10 +120,12 @@ static uv_lib_t *jl_load_dynamic_library_(const char *modname, unsigned flags, i snprintf(path, PATHBUF, "%s%s%s", dl_path, modname, ext); else snprintf(path, PATHBUF, "%s" PATHSEPSTRING "%s%s", dl_path, modname, ext); +#ifndef _OS_WINDOWS_ if (handle->errmsg) { free(handle->errmsg); handle->errmsg = NULL; } +#endif error = jl_uv_dlopen(path, handle, flags); if (!error) goto done; } @@ -136,10 +138,12 @@ static uv_lib_t *jl_load_dynamic_library_(const char *modname, unsigned flags, i handle->handle = NULL; /* try loading from standard library path */ snprintf(path, PATHBUF, "%s%s", modname, ext); +#ifndef _OS_WINDOWS_ if (handle->errmsg) { free(handle->errmsg); handle->errmsg = NULL; } +#endif error = jl_uv_dlopen(path, handle, flags); if (!error) goto done; }