From dca9b1291378ede32158a39961cd408a09bda896 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 17 Feb 2023 15:29:43 +0000 Subject: Add a handle cache for gtests ReferenceTypePropagation's BoundTypeForIfNotNull needs the handle cache to exist and could lead to crashes otherwise. Test: m test-art-host-gtest Change-Id: Ic51dc0859a7057107ab600040fb52dfc55469564 --- compiler/optimizing/optimizing_unit_test.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/optimizing_unit_test.h') diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h index 2ebaf58d65..98ba38a59a 100644 --- a/compiler/optimizing/optimizing_unit_test.h +++ b/compiler/optimizing/optimizing_unit_test.h @@ -261,9 +261,10 @@ class OptimizingUnitTestHelper { // Create a control-flow graph from Dex instructions. HGraph* CreateCFG(const std::vector& data, - DataType::Type return_type = DataType::Type::kInt32, - VariableSizedHandleScope* handles = nullptr) { - HGraph* graph = CreateGraph(handles); + DataType::Type return_type = DataType::Type::kInt32) { + ScopedObjectAccess soa(Thread::Current()); + VariableSizedHandleScope handles(soa.Self()); + HGraph* graph = CreateGraph(&handles); // The code item data might not aligned to 4 bytes, copy it to ensure that. const size_t code_item_size = data.size() * sizeof(data.front()); -- cgit v1.2.3-59-g8ed1b