Aspects icon indicating copy to clipboard operation
Aspects copied to clipboard

32-bit CPU iPhone and 64-bit CPU Mac will crash when return type is CGSize

Open onesmash opened this issue 10 years ago • 2 comments

https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/100-32-bit_PowerPC_Function_Calling_Conventions/32bitPowerPC.html#//apple_ref/doc/uid/TP40002438-SW13

Returning Results The following list describes where a function’s return value is passed to the caller.

  1. Scalars smaller than 4 bytes (such as char and short) are placed in the low word of GPR3. The register’s high word is undefined.
  2. Scalars 4 bytes in size (such as long, int, and pointers, including array pointers) are placed in GPR3.
  3. Values of type long long are returned in the high word of GPR3 and the low word of GPR4.
  4. Floating-point values are placed in FPR1.
  5. Composite values (such as struct and union) and values larger than 4 bytes are placed at the location pointed to by GPR3. See Passing Arguments for more information.
5685a99e-780d-48fb-ac01-f8126da7a710

x86_64 is more complicated, I don't know how to fix it.

onesmash avatar Sep 30 '15 11:09 onesmash

It will crash on iPhone5 when used in a static library.

expkzb avatar Jul 08 '16 02:07 expkzb

Pull Requests welcome!

steipete avatar Jul 08 '16 07:07 steipete