Repository navigation
Guard BaseViewProps downcasts in AnimationBackend (#60524) - #60524
Open
Abbondanzo wants to merge 1 commit into
Open
Abbondanzo wants to merge 1 commit into
Abbondanzo wants to merge 1 commit into
Conversation
|
@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D136090146. |
javache
approved these changes
Dec 4, 2026
javache
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Abbondanzo
added a commit
to Abbondanzo/react-native
that referenced
this pull request
Dec 5, 2026
Summary: `AnimationBackend::cloneProps` and `AnimationBackendCommitHook::shadowTreeWillCommit` previously used `std::static_pointer_cast<const BaseViewProps>` when cloning props for animated nodes. If a non-`BaseViewProps` node (such as `TextShadowNode`) receives an animated update, the unconditional static downcast is undefined behavior and writing typed view props overflows the `Props` object. Guard typed view-prop application in both paths with `std::dynamic_pointer_cast<const BaseViewProps>` and skip typed view props when the downcast is null. Changelog: [General][Fixed] - Guard `BaseViewProps` downcasts in `AnimationBackend` against non-view shadow nodes Signed-off-by: Peter Abbondanzo <abbo@meta.com> Reviewed By: javache Differential Revision: D136090146
Abbondanzo
force-pushed
the
export-D136090146
branch
from
December 5, 2026 00:04
f9274aa to
857b69c
Compare
Summary: `AnimationBackend::cloneProps` and `AnimationBackendCommitHook::shadowTreeWillCommit` previously used `std::static_pointer_cast<const BaseViewProps>` when cloning props for animated nodes. If a non-`BaseViewProps` node (such as `TextShadowNode`) receives an animated update, the unconditional static downcast is undefined behavior and writing typed view props overflows the `Props` object. Guard typed view-prop application in both paths with `std::dynamic_pointer_cast<const BaseViewProps>` and skip typed view props when the downcast is null. Changelog: [General][Fixed] - Guard `BaseViewProps` downcasts in `AnimationBackend` against non-view shadow nodes Signed-off-by: Peter Abbondanzo <abbo@meta.com> Reviewed By: javache Differential Revision: D136090146
Abbondanzo
force-pushed
the
export-D136090146
branch
from
December 5, 2026 21:00
857b69c to
6456563
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
AnimationBackend::clonePropsandAnimationBackendCommitHook::shadowTreeWillCommitpreviously usedstd::static_pointer_cast<const BaseViewProps>when cloning props for animated nodes. If a non-BaseViewPropsnode (such asTextShadowNode) receives an animated update, the unconditional static downcast is undefined behavior and writing typed view props overflows thePropsobject.Guard typed view-prop application in both paths with
std::dynamic_pointer_cast<const BaseViewProps>and skip typed view props when the downcast is null.Changelog:
[General][Fixed] - Guard
BaseViewPropsdowncasts inAnimationBackendagainst non-view shadow nodesSigned-off-by: Peter Abbondanzo abbo@meta.com
Reviewed By: javache
Differential Revision: D136090146