Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,12 @@ jl_code_info_t *jl_new_code_info_from_ir(jl_expr_t *ir)
is_flag_stmt = 1;
else if (jl_is_expr(st) && ((jl_expr_t*)st)->head == jl_return_sym)
jl_array_ptr_set(body, j, jl_new_struct(jl_returnnode_type, jl_exprarg(st, 0)));
else if (jl_is_expr(st) && (((jl_expr_t*)st)->head == jl_foreigncall_sym || ((jl_expr_t*)st)->head == jl_cfunction_sym))
li->has_fcall = 1;
else {
if (jl_is_expr(st) && ((jl_expr_t*)st)->head == jl_assign_sym)
st = jl_exprarg(st, 1);
if (jl_is_expr(st) && (((jl_expr_t*)st)->head == jl_foreigncall_sym || ((jl_expr_t*)st)->head == jl_cfunction_sym))
li->has_fcall = 1;
}
if (is_flag_stmt)
jl_array_uint32_set(li->ssaflags, j, 0);
else {
Expand Down
5 changes: 5 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8443,3 +8443,8 @@ f_call_me() = invoke(f_invoke_me, f_invoke_me_ci)
f_invalidate_me() = 2
@test_throws ErrorException invoke(f_invoke_me, f_invoke_me_ci)
@test_throws ErrorException f_call_me()

myfun57023a(::Type{T}) where {T} = (x = @ccall mycfun()::Ptr{T}; x)
@test only(code_lowered(myfun57023a)).has_fcall
myfun57023b(::Type{T}) where {T} = (x = @cfunction myfun57023a Ptr{T} (Ref{T},); x)
@test only(code_lowered(myfun57023b)).has_fcall