]> git.lizzy.rs Git - rust.git/commit
auto merge of #5726 : brson/rust/struct-return, r=brson
authorbors <bors@rust-lang.org>
Thu, 18 Apr 2013 01:45:58 +0000 (18:45 -0700)
committerbors <bors@rust-lang.org>
Thu, 18 Apr 2013 01:45:58 +0000 (18:45 -0700)
commitfdb4ef321ed5eee681c2b723dcb157c280aa72f2
tree7f38fcabd13cba2ff4577b32360abe43720490fc
parent68dea752967fa2c7e0c4b82f476086457c93fff7
parenta5ddc009829bef149a9e2f127e80609589604443
auto merge of #5726 : brson/rust/struct-return, r=brson

r? @nikomatsakis

This doesn't completely fix the x86 ABI for structs, but it does fix some cases. On linux, structs appear to be returned correctly now. On windows, structs are only returned by pointer when they are greater than 8 bytes. That scenario works now.

In the case where the struct is less than 8 bytes our generated code looks peculiar. When returning a pair of u16, C packs both variables into %eax to return them. Our generated code though expects to find one of the pair in %ax and the other in %dx. Similar for u8. I haven't looked into it yet.

There appears to also be struct passing problems on linux, where my `extern-pass-TwoU8s` and `extern-pass-TwoU16s` tests are failing.