lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
245 stars 17 forks source link

51294267: Calling self.titleLabel within [UIButton titleRectForContentRect:] causes infinite loop #21288

Open openradar-mirror opened 5 years ago

openradar-mirror commented 5 years ago

Description

Summary: We noticed that when using self.titleLabel within UIButton's titleRectForContentRect: method, this will result in an infinite loop. We have to use the titleLabel property here though due to another bug in the iOS SDK. Nevertheless, using self.titleLabel here shouldn't result in an infinite loop and therefore a crash.

Steps to Reproduce: Subclass UIButton, override titleRectForContentRect: method, add the super call, use self.titleLabel.numberOfLines for example. This will ultimately result in EXC_BAD_ACCESS (code=2, address=0x7ffee6c91ff0).

Expected Results: Using self.titleLabel in -titleRectForContentRect: shouldn't cause an infinite loop.

Actual Results: Using self.titleLabel in -titleRectForContentRect: causes an infinite loop.

Version/Build: iOS 12.2

- Product Version: 12.2 Created: 2019-05-31T07:55:35.792535 Originated: 2019-05-31T00:00:00 Open Radar Link: http://www.openradar.me/51294267