mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
c34e554275
Summary: Address Sanitizer told me that I have UB in `RCTUIFontWeightFromFloat` and it was right. After a short investigation, I find out that the original assumption that `UIFontWeight` values are practically numbers from 100 to 900 was incorrect. In my simulator, it's something like from `-1` to `+1` (irregularly!). So, the whole subsystem worked only by accident. This diff fixes that; now we never assume which actual values `UIFontWeight` constants have. I will publish code style fixes as a separate diff (otherwise it will be really hard to review). Reviewed By: JoshuaGross Differential Revision: D15756620 fbshipit-source-id: d7f888e85815d863487c6b68a960e39fd473e095