From 394b60b655bd7c4c0904263bd56f72387bd4cef3 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 24 Jan 2025 14:05:40 +0100 Subject: [PATCH] fixup! move gc_safe to cconv field --- src/ccall.cpp | 5 +++-- src/method.c | 2 +- test/ccall.jl | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ccall.cpp b/src/ccall.cpp index 129378e53c3f4..6ac9a2218c54e 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -1169,7 +1169,7 @@ class function_sig_t { jl_codectx_t &ctx, const native_sym_arg_t &symarg, jl_cgval_t *argv, - SmallVector &gc_uses, + SmallVectorImpl &gc_uses, bool static_rt) const; private: @@ -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); @@ -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 &gc_uses, + SmallVectorImpl &gc_uses, bool static_rt) const { ++EmittedCCalls; diff --git a/src/method.c b/src/method.c index 93531252cfde4..d03bd09d3d145 100644 --- a/src/method.c +++ b/src/method.c @@ -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); diff --git a/test/ccall.jl b/test/ccall.jl index 9e6f57ca98cf6..b10504de21abc 100644 --- a/test/ccall.jl +++ b/test/ccall.jl @@ -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),