Skip to content

Commit

Permalink
Merge pull request #21193 from JuliaLang/jn/precompile-fixes
Browse files Browse the repository at this point in the history
minor precompile fixes
  • Loading branch information
vtjnash authored Mar 29, 2017
2 parents a78fb95 + a159ac5 commit 4fe28fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 4 additions & 3 deletions base/interactiveutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ function edit(path::AbstractString, line::Integer=0)
end

if is_windows() && name == "open"
systemerror(:edit, ccall((:ShellExecuteW,"shell32"), stdcall, Int,
(Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint),
C_NULL, "open", path, C_NULL, C_NULL, 10) 32)
@static is_windows() && # don't emit this ccall on other platforms
systemerror(:edit, ccall((:ShellExecuteW, "shell32"), stdcall, Int,
(Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint),
C_NULL, "open", path, C_NULL, C_NULL, 10) 32)
elseif background
spawn(pipeline(cmd, stderr=STDERR))
else
Expand Down
12 changes: 10 additions & 2 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,15 @@ static void jl_update_all_fptrs(void)
{
//jl_printf(JL_STDOUT, "delayed_fptrs_n: %d\n", delayed_fptrs_n);
void **fvars = sysimg_fvars;
if (fvars == 0) return;
if (fvars == NULL) {
size_t i;
for (i = 0; i < delayed_fptrs_n; i++) {
jl_method_instance_t *li = delayed_fptrs[i].li;
assert(li->jlcall_api && li->jlcall_api != 2);
li->jlcall_api = 0;
}
return;
}
// jl_fptr_to_llvm needs to decompress some ASTs, therefore this needs to be NULL
// to skip trying to restore GlobalVariable pointers in jl_deserialize_gv
sysimg_gvars = NULL;
Expand All @@ -431,7 +439,7 @@ static void jl_update_all_fptrs(void)
jl_method_instance_t **linfos = (jl_method_instance_t**)malloc(sizeof(jl_method_instance_t*) * sysimg_fvars_max);
for (i = 0; i < delayed_fptrs_n; i++) {
jl_method_instance_t *li = delayed_fptrs[i].li;
assert(li->def);
assert(li->def && li->jlcall_api && li->jlcall_api != 2);
int32_t cfunc = delayed_fptrs[i].cfunc - 1;
if (cfunc >= 0) {
jl_fptr_to_llvm((jl_fptr_t)fvars[cfunc], li, 1);
Expand Down

0 comments on commit 4fe28fb

Please sign in to comment.