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/entrypoints/entrypoint_utils-inl.h | |
parent | 1b192268f167f603fc372f02f9067f3ce5d82daf (diff) | |
download | android_art-58a5af8568d224ca7eccf2483396ff9862f8d1ee.tar.gz android_art-58a5af8568d224ca7eccf2483396ff9862f8d1ee.tar.bz2 android_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/entrypoints/entrypoint_utils-inl.h')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils-inl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h index cb0be04d5c..af71c19b57 100644 --- a/runtime/entrypoints/entrypoint_utils-inl.h +++ b/runtime/entrypoints/entrypoint_utils-inl.h @@ -40,7 +40,7 @@ template <const bool kAccessCheck> static inline mirror::Class* CheckObjectAlloc(uint32_t type_idx, mirror::ArtMethod* method, Thread* self, bool* slow_path) { - mirror::Class* klass = method->GetDexCacheResolvedTypes()->GetWithoutChecks(type_idx); + mirror::Class* klass = method->GetDexCacheResolvedType<false>(type_idx); if (UNLIKELY(klass == NULL)) { klass = Runtime::Current()->GetClassLinker()->ResolveType(type_idx, method); *slow_path = true; @@ -178,7 +178,7 @@ static inline mirror::Class* CheckArrayAlloc(uint32_t type_idx, *slow_path = true; return nullptr; // Failure } - mirror::Class* klass = method->GetDexCacheResolvedTypes()->GetWithoutChecks(type_idx); + mirror::Class* klass = method->GetDexCacheResolvedType<false>(type_idx); if (UNLIKELY(klass == nullptr)) { // Not in dex cache so try to resolve klass = Runtime::Current()->GetClassLinker()->ResolveType(type_idx, method); *slow_path = true; |