Skip to content
  • batterseapower's avatar
    Pop OS X stack padding even if the foreign call is stdcall (#5052) · 7a29845e
    batterseapower authored
    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.
    7a29845e