Pop OS X stack padding even if the foreign call is stdcall (#5052)
The problem was that the codegen for foreign calls makes sure the stack is 16-byte aligned on OS X by pushing some padding. In the case where the foreign call is cdecl, that padding gets popped after the call, but if the convention is stdcall then it doesn't generate any popping code at all. However, this is incorrect because the stdcall only promises to pop the arguments, not the padding. The fix is to generate code to pop the padding (if any) on OS X.
Showing with 16 additions and 4 deletions