NSInvocation fails with struct with 3 or more variables of different type(defs) of the same underlying type
| Originator: | tadeuzagallo | ||
| Number: | rdar://20778823 | Date Originated: | 01-May-2015 05:30 PM |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 8.2 |
| Classification: | Reproducible: | Always |
Summary:
When running on the device, on arm64, NSInvocation crashes with bad access, if you try to return a struct, with 3 or more variables, with 2 or more different type(defs) of the same underlying type, i.e. double, double, NSTimeInterval
Steps to Reproduce:
typedef struct {
NSTimeInterval t0;
double t1;
double t2;
} Foo;
- (Foo)check
{
Foo f = (Foo){
.t0 = 1,
.t1 = 1,
.t2 = 1,
};
return f;
}
SEL selector = @selector(check);
NSMethodSignature *sig = [self methodSignatureForSelector:selector];
NSInvocation *i = [NSInvocation invocationWithMethodSignature:sig];
[i setTarget:self];
[i setSelector:selector];
[i invoke];
Expected Results:
The call should return the actual struct.
Actual Results:
EXC_BAD_ACCESS when returning it.
Version:
8.2 (12D508)
Notes:
Changing t0 to double prevents the crash.
Xcode Version 6.2 (6C131e)
Configuration:
iPhone 6 64gb
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!