Skip to content

Commit f821613

Browse files
javachemeta-codesync[bot]
authored andcommitted
Fix use-after-move of ContextContainer in PointerEventsProcessorTest (#57812)
Summary: Pull Request resolved: #57812 The whole `PointerEventsProcessorTest` suite has been aborting in its fixture constructor since the `modernize-use-designated-initializers` codemod moved the `ContextContainer` into `ComponentDescriptorParameters`. The `shared_ptr` is read twice more afterwards — once to construct the `UIManager` and once to construct the `ShadowTree` — so the move left both with a null container and the second read tripped the libstdc++ null-deref assert. Stop moving out of a `shared_ptr` that is still needed by later statements. Changelog: [Internal] ___ Differential Revision: D114730311 fbshipit-source-id: e7fe2b5bbc40dcbf9571cc917ec6e78baf49524a
1 parent 65008fc commit f821613

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class PointerEventsProcessorTest : public ::testing::Test {
4444
componentDescriptorProviderRegistry.createComponentDescriptorRegistry(
4545
ComponentDescriptorParameters{
4646
.eventDispatcher = eventDispatcher,
47-
.contextContainer = std::move(contextContainer),
47+
.contextContainer = contextContainer,
4848
.flavor = nullptr});
4949

5050
componentDescriptorProviderRegistry.add(

0 commit comments

Comments
 (0)