On 64-bit, va_arg does not pass in all arguments via stack, instead some are passed in via registers. GCC/Clang expand these correctly to the argument list, but MSVC does some funky shit and would require some manual macro hell to correctly expand the arguments from registers to the va_arg call. By doing VM_Call like this, we avoid passing in random integers to mod in vmMain arguments.
On 64-bit,
va_arg
does not pass in all arguments via stack, instead some are passed in via registers. GCC/Clang expand these correctly to the argument list, but MSVC does some funky shit and would require some manual macro hell to correctly expand the arguments from registers to theva_arg
call. By doingVM_Call
like this, we avoid passing in random integers to mod invmMain
arguments.https://blog.nelhage.com/2010/10/amd64-and-va_arg/