Thunks that return member pointers via sret are broken due to using temporary storage for the return value on the stack, and then passing that pointer to a tail call, violating the rule that a tail call can't access allocas in the caller (see bug).
Since r90526 (Eli), we put aggregate return values directly in the sret slot, but this doesn't apply to member pointers which are considered scalar.
Maybe I'm missing something subtle, but why not always use the sret slot directly for indirect return values? This patch does that, fixing the thunks.
Please take a look.