Skip to content

Conversation

@al45tair
Copy link
Contributor

On 32-bit Windows, a number of different calling conventions are in use, but Swift ignores them when generating call instructions in IRGen, and generates calls that always use the default calling convention, cdecl. This results in stack corruption, because stdcall uses the ret <nn> instruction, which adds its argument to the stack pointer on return.

rdar://163178024

On 32-bit Windows, a number of different calling conventions are in use, but
Swift ignores them when generating call instructions in IRGen, and generates
calls that always use the default calling convention, `cdecl`.  This results in
stack corruption, because `stdcall` uses the `ret <nn>` instruction, which adds
its argument to the stack pointer on return.

rdar://163178024
@al45tair
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@al45tair
Copy link
Contributor Author

@swift-ci Please test

We're now passing through the calling convention to LLVM IR (which
is correct, but we weren't doing previously).

rdar://163178024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant