Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

support x86_64 return calling conventions #610

Merged
merged 2 commits into from
May 22, 2016
Merged

Conversation

ericbuehl
Copy link
Contributor

Covers issues that arise when structs are larger than 8 bytes are returned on the call stack on x86_64 targets. I'm not sure if there may be other places this comes up, but I think this is a start.

@sharplet
Copy link
Contributor

Thanks for the PR! ✨

This is a little outside of my area of expertise, but: any idea how we can test this? I assume there's cases where if the size is incorrect, we could crash?

Probably tricky, but I definitely think it would be great to have a reproducible crash that this patch fixes!

@ericbuehl
Copy link
Contributor Author

Yeah, this is pretty hard to test. It depends on the architecture being built as well as the whim of the compiler. In my case it was rare for the x86_64 compiler to use more than 8 bytes but when it did, it would cause a crash. Based on http://wiki.osdev.org/Calling_Conventions I'm concluding that this can be allowed to be up to 16 bytes on x86_64; sizeof(rax + rdx)

@orta
Copy link
Contributor

orta commented May 21, 2016

This is probably good to merge 👍

@sharplet sharplet merged commit 7ee428d into kiwi-bdd:master May 22, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants