erikdoe / ocmock

Mock objects for Objective-C
http://ocmock.org
Apache License 2.0
2.16k stars 606 forks source link

Fix iOS device ptrath failures by caching all OCMPassByRefSetters. #529

Closed strangewiz closed 1 year ago

strangewiz commented 1 year ago

Fix iOS device ptrath failures by caching all OCMPassByRefSetters rather than checking with object_getClass.

erikdoe commented 1 year ago

Can you please provide a little more detail on which issue this PR is meant to fix and why it is necessary to check the instances rather than the class?

strangewiz commented 1 year ago

Hi Erik! -resolveSpecialValues in OCMArg calls object_getClass to verify if an object is OCMPassByRefSetters. Since iOS15 the pointer referenced may not always be an objective-c object, so that object_getClass call will crash.

erikdoe commented 1 year ago

How is this different from #503?