diff --git a/gen/abi-x86-64.cpp b/gen/abi-x86-64.cpp index 29158674..8da094d7 100644 --- a/gen/abi-x86-64.cpp +++ b/gen/abi-x86-64.cpp @@ -425,7 +425,11 @@ bool X86_64TargetABI::returnInArg(TypeFunction* tf) { return false; #endif // All non-structs can be returned in registers. - return (rt->ty == Tstruct); + return rt->ty == Tstruct +#if SARRAYVALUE + || rt->ty == Tsarray +#endif + ; } else { if (rt == Type::tvoid || keepUnchanged(rt)) return false; diff --git a/gen/abi-x86.cpp b/gen/abi-x86.cpp index ddc87236..8f7c02d3 100644 --- a/gen/abi-x86.cpp +++ b/gen/abi-x86.cpp @@ -89,7 +89,13 @@ struct X86TargetABI : TargetABI Type* rt = tf->next->toBasetype(); // D only returns structs on the stack if (tf->linkage == LINKd) - return (rt->ty == Tstruct); + { + return rt->ty == Tstruct +#if SARRAYVALUE + || rt->ty == Tsarray +#endif + ; + } // other ABI's follow C, which is cdouble and creal returned on the stack // as well as structs else