erikdoe / ocmock

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

Fix up crash when calling object_getClass on non object. #503

Closed dmaclach closed 1 year ago

dmaclach commented 3 years ago

This fixes up a crash that was found in Chrome when running on an iOS 15 device. It did not show up on the simulator.

https://chromium-review.googlesource.com/c/chromium/src/+/3011651

Calling object_getClass on something that isn't an object is at best undefined behavior.

mlw commented 2 years ago

Hit this same issue when running some tests on ARM-based Macs. The same tests would pass on x86. Pulling in this PR solved the problem.