https://issues.dlang.org/show_bug.cgi?id=17454

--- Comment #2 from Walter Bright <bugzi...@digitalmars.com> ---
> d_fun returns a struct by value which appears by looking at the disassembly 
> that d_fun allocates room for the result value on it's stack, and then 
> returns a pointer to the result in RAX.

D never does that, because then d_fun() would be returning a pointer into its
own stack, which has expired and hence is a big no-no.

What does happen is d_fun()'s caller allocates S, and then passes a pointer to
S to d_fun(), and d_fun() fills it in and returns that pointer to S.

But if S fits in a register, this does not happen, as the disassembly shows.

--

Reply via email to