Skip to content

Fix Yoga Style equality crash for size-typed dimensions#56429

Closed
sbuggay wants to merge 1 commit into
react:mainfrom
sbuggay:export-D100189121
Closed

Fix Yoga Style equality crash for size-typed dimensions#56429
sbuggay wants to merge 1 commit into
react:mainfrom
sbuggay:export-D100189121

Conversation

@sbuggay

@sbuggay sbuggay commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary:
Changelog: [Internal]

The existing lengthsEqual comparator was used for dimensions_, minDimensions_, and maxDimensions_, but these are size-typed values stored via StyleValuePool::getSize(), not length-typed. Using the wrong accessor caused crashes during style equality checks.

Added a sizeLengthsEqual helper (scalar + array overloads) that correctly calls StyleValuePool::getSize() and swapped it in for the three dimension fields in Style::operator==.

Differential Revision: D100189121

Summary:
Changelog: [Internal]

The existing `lengthsEqual` comparator was used for `dimensions_`, `minDimensions_`, and `maxDimensions_`, but these are size-typed values stored via `StyleValuePool::getSize()`, not length-typed. Using the wrong accessor caused crashes during style equality checks.

Added a `sizeLengthsEqual` helper (scalar + array overloads) that correctly calls `StyleValuePool::getSize()` and swapped it in for the three dimension fields in `Style::operator==`.

Differential Revision: D100189121
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 13, 2026
@meta-codesync

meta-codesync Bot commented Apr 13, 2026

Copy link
Copy Markdown

@sbuggay has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100189121.

sbuggay added a commit to sbuggay/yoga that referenced this pull request Apr 13, 2026
Summary:
X-link: react/react-native#56429

Changelog: [Internal]

The existing `lengthsEqual` comparator was used for `dimensions_`, `minDimensions_`, and `maxDimensions_`, but these are size-typed values stored via `StyleValuePool::getSize()`, not length-typed. Using the wrong accessor caused crashes during style equality checks.

Added a `sizeLengthsEqual` helper (scalar + array overloads) that correctly calls `StyleValuePool::getSize()` and swapped it in for the three dimension fields in `Style::operator==`.

Differential Revision: D100189121
meta-codesync Bot pushed a commit to react/yoga that referenced this pull request Apr 14, 2026
Summary:
Pull Request resolved: #1931

X-link: react/react-native#56429

Changelog: [Internal]

The existing `lengthsEqual` comparator was used for `dimensions_`, `minDimensions_`, and `maxDimensions_`, but these are size-typed values stored via `StyleValuePool::getSize()`, not length-typed. Using the wrong accessor caused crashes during style equality checks.

Added a `sizeLengthsEqual` helper (scalar + array overloads) that correctly calls `StyleValuePool::getSize()` and swapped it in for the three dimension fields in `Style::operator==`.

Reviewed By: joevilches

Differential Revision: D100189121

fbshipit-source-id: 284f849d01ca7d15ca34d2dcaafaa92ee9dfd59f
@meta-codesync meta-codesync Bot closed this in 40c7d8f Apr 14, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Apr 14, 2026
@meta-codesync

meta-codesync Bot commented Apr 14, 2026

Copy link
Copy Markdown

This pull request has been merged in 40c7d8f.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @sbuggay in 40c7d8f

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants