Skip to content

Commit

Permalink
fixup! move gc_safe to cconv field
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Jan 24, 2025
1 parent d1e743e commit 394b60b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ class function_sig_t {
jl_codectx_t &ctx,
const native_sym_arg_t &symarg,
jl_cgval_t *argv,
SmallVector<Value*> &gc_uses,
SmallVectorImpl<Value*> &gc_uses,
bool static_rt) const;

private:
Expand Down Expand Up @@ -1439,6 +1439,7 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs)
cc_sym = (jl_sym_t*)jl_get_nth_field_noalloc(jlcc, 0);
gc_safe = jl_unbox_bool(jl_get_nth_field_noalloc(jlcc, 2));
}
assert(jl_is_symbol(cc_sym));
native_sym_arg_t symarg = {};
JL_GC_PUSH3(&rt, &at, &symarg.gcroot);

Expand Down Expand Up @@ -1982,7 +1983,7 @@ jl_cgval_t function_sig_t::emit_a_ccall(
jl_codectx_t &ctx,
const native_sym_arg_t &symarg,
jl_cgval_t *argv,
SmallVector<Value*> &gc_uses,
SmallVectorImpl<Value*> &gc_uses,
bool static_rt) const
{
++EmittedCCalls;
Expand Down
2 changes: 1 addition & 1 deletion src/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static jl_value_t *resolve_definition_effects(jl_value_t *expr, jl_module_t *mod
return expr;
}
if (e->head == jl_foreigncall_sym) {
JL_NARGSV(ccall method definition, 6); // (fptr, rt, at, nreq, gc_safe, (cc, effects))
JL_NARGSV(ccall method definition, 5); // (fptr, rt, at, nreq, (cc, effects, gc_safe))
jl_task_t *ct = jl_current_task;
jl_value_t *rt = jl_exprarg(e, 1);
jl_value_t *at = jl_exprarg(e, 2);
Expand Down
2 changes: 1 addition & 1 deletion test/ccall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ end
Core.svec(Ptr{Ptr{Cchar}}, Cstring,
UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8,
Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat),
2, false, :(:cdecl),
2, :(:cdecl),
:(Base.unsafe_convert(Ptr{Ptr{Cchar}}, strp)), :(Base.unsafe_convert(Cstring, fmt)),
0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf,
Cfloat(1.1), Cfloat(2.2), Cfloat(3.3), Cfloat(4.4), Cfloat(5.5), Cfloat(6.6), Cfloat(7.7), Cfloat(8.8), Cfloat(9.9),
Expand Down

0 comments on commit 394b60b

Please sign in to comment.