summaryrefslogtreecommitdiff
path: root/compiler/optimizing/load_store_analysis_test.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2021-06-01 09:26:55 +0100
committerVladimir Marko <vmarko@google.com>2021-06-02 08:11:39 +0000
commitce822b690c82e3ab518b1bf1a8c35d8c11bd3556 (patch)
treec5905c45090052cae9f7181f4d718204de4a674b /compiler/optimizing/load_store_analysis_test.cc
parentc3854243a9e3de6e5ac3a25d31439e8cf40af1bf (diff)
Avoid race on Thread::tlsPtr_::top_handle_scope.
Require mutator lock for that field and update tests to hold the mutator lock when needed. This prevents GC thread that executes a thread roots flip on behalf of suspended threads from racing against construction or destruction of handle scopes by those threads and possibly seeing invalid values. (cherry picked from commit 1d326f94a3fdd6292ccdf0022cedfb2a2b8acfee) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 189439174 Merged-In: I268a0ef6e5aa838347956febca0d3b6e02fe3ae5 Change-Id: If4cdcf4a488e77cb5aa7748de7c77c49f04388b0
Diffstat (limited to 'compiler/optimizing/load_store_analysis_test.cc')
-rw-r--r--compiler/optimizing/load_store_analysis_test.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/optimizing/load_store_analysis_test.cc b/compiler/optimizing/load_store_analysis_test.cc
index 67abc0fc20..cebc3f34f9 100644
--- a/compiler/optimizing/load_store_analysis_test.cc
+++ b/compiler/optimizing/load_store_analysis_test.cc
@@ -1265,7 +1265,8 @@ TEST_F(LoadStoreAnalysisTest, PartialEscape4) {
// // EXIT
// obj.field;
TEST_F(LoadStoreAnalysisTest, PartialEscape5) {
- VariableSizedHandleScope vshs(Thread::Current());
+ ScopedObjectAccess soa(Thread::Current());
+ VariableSizedHandleScope vshs(soa.Self());
CreateGraph(&vshs);
AdjacencyListGraph blks(SetupFromAdjacencyList(
"entry",