Skip to content

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

Open
sbuggay wants to merge 1 commit intofacebook:mainfrom
sbuggay:export-D100189121
Open

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

Conversation

@sbuggay
Copy link
Copy Markdown
Contributor

@sbuggay sbuggay commented Apr 13, 2026

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
Copy link
Copy Markdown

meta-codesync bot commented Apr 13, 2026

@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: facebook/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
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 meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant