Closed hmelder closed 2 months ago
WindowsBuildLabEx : 22621.1.arm64fre.ni_release.220506-1250
OSDisplayVersion : 23H2
OsName : Microsoft Windows 11 Pro
OsType : WINNT
OsVersion : 10.0.22631
I updated the function name to objc_msgSend_stret2
.
Once this is in, can you cherry pick it into the release branch and we’ll cut a new point release for it.
the release branch
I assume 2.2?
Yup, let's do a 2.2.2 that includes this.
The current implementation inaccurately handles sret for types that are not passed via registers by assuming that the caller always places a pointer to the memory block in register x8.
According to the correct convention, the caller should allocate a memory block of adequate size and alignment for the result. For POD types, the memory address should be passed in register x8, and for non-POD types, in register x0.
Clang generates an
objc_msgSend_sret
call for return types marked with sret, including non-trivial types tagged asinreg
on ARM64 Windows. To preserve compatibility with existing behaviors, we cannot modifyobjc_msgSend_sret
.Instead, I propose introducing a new function,
objc_msgSend_sret2_np
, which expects the receiver in register x1 and the selector in register x2, to handle these cases properly.In clang, we check for the
inreg
tag to be present and choose the new function overobjc_msgSend_sret
.This issue has been documented and is being tracked in the llvm-project repository under issue #88273.