diff --git a/doc/src/manual/calling-c-and-fortran-code.md b/doc/src/manual/calling-c-and-fortran-code.md index 628b6d9be44c8..2b0242cd5eabf 100644 --- a/doc/src/manual/calling-c-and-fortran-code.md +++ b/doc/src/manual/calling-c-and-fortran-code.md @@ -883,8 +883,8 @@ be computed at run time. To handle such cases, the library component of a `(name specification can be a function call, e.g. `(:dgemm_, find_blas())`. The call expression will be executed when the `ccall` itself is executed. However, it is assumed that the library location does not change once it is determined, so the result of the call can be cached and -reused. Therefore, the number of times the expression executes is undefined, and returning -different values for multiple calls results in undefined behavior. +reused. Therefore, the number of times the expression executes is unspecified, and returning +different values for multiple calls results in unspecified behavior. If even more flexibility is needed, it is possible to use computed values as function names by staging through [`eval`](@ref) as follows: diff --git a/src/ccall.cpp b/src/ccall.cpp index 5a8fc45200eaf..855ec4ff7e187 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -166,8 +166,7 @@ static Value *runtime_sym_lookup( gvname += f_name; gvname += "_"; gvname += std::to_string(globalUnique++); - Module *M = ctx.emission_context.shared_module(jl_LLVMContext); - llvmgv = new GlobalVariable(*M, T_pvoidfunc, false, + llvmgv = new GlobalVariable(*jl_Module, T_pvoidfunc, false, GlobalVariable::ExternalLinkage, Constant::getNullValue(T_pvoidfunc), gvname); }