From f8216139caa3a13c033b45efe3a72fad8263ae9c Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 6 Aug 2026 02:58:49 -0700 Subject: [PATCH] Fix use-after-move of ContextContainer in PointerEventsProcessorTest (#57812) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/react/react-native/pull/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 --- .../renderer/uimanager/tests/PointerEventsProcessorTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp index f868cf4d0f2..35f0a714de7 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp @@ -44,7 +44,7 @@ class PointerEventsProcessorTest : public ::testing::Test { componentDescriptorProviderRegistry.createComponentDescriptorRegistry( ComponentDescriptorParameters{ .eventDispatcher = eventDispatcher, - .contextContainer = std::move(contextContainer), + .contextContainer = contextContainer, .flavor = nullptr}); componentDescriptorProviderRegistry.add(