Commit 18cb1b35 authored by Committed by Daniel KochmańskiBrowse files
fix for calling conventions treating fixed and variadic arguments differently
Previously, we assumed that the fixed and variadic arguments of a variadic function were passed to the function in the same way. The arm64 calling convention used by iOS breaks this assumption by passing fixed arguments in registers or on the stack, depending on the position, while variadic arguments are always passed on the stack. Solving this problem while still allowing function redefinition at runtime requires introducing additional dispatch functions. These dispatch functions take no fixed arguments and pass all their arguments to the actual function. This dispatch is enabled by passing -DECL_C_COMPATIBLE_VARIADIC_DISPATCH to the C compiler. This problem was originally identified and a solution provided by email@example.com. This commit based on his work with minor improvements.