Hi, Sergey, thanks for the patch! LGTM Sergey On 5/30/26 19:04, Sergey Kaplun wrote: > From: Mike Pall > > Thanks to Sergey Kaplun. > > (cherry picked from commit b925b3e3fc6771171602323b45fbe9fb8fc90369) > > This patch fixes the regression in the arm64 OSX FFI behaviour when the > fundamental C types are passed via the stack. The given arguments should > occupy the "packed" size on the stack if they are fundamental C > types [1]. Structures require the pointer-size alignment like it was done > in the previous commit. This patch fixes that (not only for enums but for > other data types too). This fixes the tests that were failing after the > previous commit. > > [1]:https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Pass-arguments-to-functions-correctly > > Sergey Kaplun: > * added the description for the problem > > Part of tarantool/tarantool#12480 > --- > src/lj_ccall.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/lj_ccall.c b/src/lj_ccall.c > index 1beccc10..7c3ec1e5 100644 > --- a/src/lj_ccall.c > +++ b/src/lj_ccall.c > @@ -1082,7 +1082,7 @@ static int ccall_set_args(lua_State *L, CTState *cts, CType *ct, > if (CCALL_ALIGN_STACKARG) { /* Align argument on stack. */ > MSize align = (1u << ctype_align(ccall_struct_align(cts, d))) - 1; > #if LJ_TARGET_ARM64 && LJ_TARGET_OSX > - isva = 1; > + isva = ctype_isstruct(d->info); > #endif > if (rp || (CCALL_PACK_STACKARG && isva && align < CTSIZE_PTR-1)) > align = CTSIZE_PTR-1;