diff options
author | Andreas Gampe <agampe@google.com> | 2014-07-31 16:23:49 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-08-06 15:57:05 -0700 |
commit | 58a5af8568d224ca7eccf2483396ff9862f8d1ee (patch) | |
tree | 4dfac17316970040e079244523b9b1e2ea163f05 /runtime/class_linker_test.cc | |
parent | 1b192268f167f603fc372f02f9067f3ce5d82daf (diff) | |
download | art-58a5af8568d224ca7eccf2483396ff9862f8d1ee.tar.gz art-58a5af8568d224ca7eccf2483396ff9862f8d1ee.tar.bz2 art-58a5af8568d224ca7eccf2483396ff9862f8d1ee.zip |
ART: Add guards to the dex cache and its shortcuts
Do not return fields, methods or classes if the (declaring) class is
erroneous.
Bug: 16692788
Change-Id: If43c2414ad0eb22db5eba7cf66396c7f16c26597
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r-- | runtime/class_linker_test.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc index 8e16d9bd49..8d9326583d 100644 --- a/runtime/class_linker_test.cc +++ b/runtime/class_linker_test.cc @@ -156,20 +156,20 @@ class ClassLinkerTest : public CommonRuntimeTest { } void AssertMethod(mirror::ArtMethod* method) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - EXPECT_TRUE(method != NULL); - EXPECT_TRUE(method->GetClass() != NULL); - EXPECT_TRUE(method->GetName() != NULL); + EXPECT_TRUE(method != nullptr); + EXPECT_TRUE(method->GetClass() != nullptr); + EXPECT_TRUE(method->GetName() != nullptr); EXPECT_TRUE(method->GetSignature() != Signature::NoSignature()); - EXPECT_TRUE(method->GetDexCacheStrings() != NULL); - EXPECT_TRUE(method->GetDexCacheResolvedMethods() != NULL); - EXPECT_TRUE(method->GetDexCacheResolvedTypes() != NULL); + EXPECT_TRUE(method->GetDexCacheStrings() != nullptr); + EXPECT_TRUE(method->HasDexCacheResolvedMethods()); + EXPECT_TRUE(method->HasDexCacheResolvedTypes()); EXPECT_EQ(method->GetDeclaringClass()->GetDexCache()->GetStrings(), method->GetDexCacheStrings()); - EXPECT_EQ(method->GetDeclaringClass()->GetDexCache()->GetResolvedMethods(), - method->GetDexCacheResolvedMethods()); - EXPECT_EQ(method->GetDeclaringClass()->GetDexCache()->GetResolvedTypes(), - method->GetDexCacheResolvedTypes()); + EXPECT_TRUE(method->HasSameDexCacheResolvedMethods( + method->GetDeclaringClass()->GetDexCache()->GetResolvedMethods())); + EXPECT_TRUE(method->HasSameDexCacheResolvedTypes( + method->GetDeclaringClass()->GetDexCache()->GetResolvedTypes())); } void AssertField(mirror::Class* klass, mirror::ArtField* field) |