diff options
author | Serguei Katkov <serguei.i.katkov@intel.com> | 2014-05-26 11:23:39 +0700 |
---|---|---|
committer | Serguei Katkov <serguei.i.katkov@intel.com> | 2014-06-02 10:41:55 +0700 |
commit | a309d76d4c9f4e5564b09708004bf4b2e3401bb3 (patch) | |
tree | 64390ebfb947779a72bf1c3cb950778d1c90b9bc /compiler/driver/compiler_driver_test.cc | |
parent | e4283be97047a26d3476acd3863dcc386498be17 (diff) | |
download | art-a309d76d4c9f4e5564b09708004bf4b2e3401bb3.zip art-a309d76d4c9f4e5564b09708004bf4b2e3401bb3.tar.gz art-a309d76d4c9f4e5564b09708004bf4b2e3401bb3.tar.bz2 |
Fix GC race condition in visit roots
While GC visits roots other code can change the set pending exception
due to lack of synchronization.
Change-Id: If387944ac933a66fe176df066c3a0ea52131cad4
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
Diffstat (limited to 'compiler/driver/compiler_driver_test.cc')
-rw-r--r-- | compiler/driver/compiler_driver_test.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc index 964dfeb..ca956aa 100644 --- a/compiler/driver/compiler_driver_test.cc +++ b/compiler/driver/compiler_driver_test.cc @@ -173,7 +173,10 @@ TEST_F(CompilerDriverTest, AbstractMethodErrorStub) { env_->ExceptionClear(); jclass jlame = env_->FindClass("java/lang/AbstractMethodError"); EXPECT_TRUE(env_->IsInstanceOf(exception, jlame)); - Thread::Current()->ClearException(); + { + ScopedObjectAccess soa(Thread::Current()); + Thread::Current()->ClearException(); + } } // TODO: need check-cast test (when stub complete & we can throw/catch |