lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Looks like there was a bug in luaffi when passing parameters to
> functions on the stack on x86-64 platform. I have not found definitive
> documentation clarifying this (if anyone can provide a reference that
> would be very helpful) but it seems that stack arguments must be at 8
> byte boundaries.

The two dominant x86-64 calling conventions in an overview:
https://en.wikipedia.org/wiki/X86_calling_conventions#x86-64_calling_conventions

For once, the one used on Windows is simpler:
https://docs.microsoft.com/en-us/cpp/build/calling-convention

Especially varargs can be a challenge on the SysV x86-64 ABI:
https://blog.nelhage.com/2010/10/amd64-and-va_arg/