diff options
author | Vladimir Marko <vmarko@google.com> | 2014-01-31 15:03:55 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-02-03 18:15:13 +0000 |
commit | 89786437f4c0176b35ca0376153dd18ab7df4924 (patch) | |
tree | c1b233f9e036c14f7a39d722a7a34874253307c1 /runtime/entrypoints/entrypoint_utils.h | |
parent | 1f00671edaaa34578319d0fdaf605600ed539d41 (diff) | |
download | art-89786437f4c0176b35ca0376153dd18ab7df4924.zip art-89786437f4c0176b35ca0376153dd18ab7df4924.tar.gz art-89786437f4c0176b35ca0376153dd18ab7df4924.tar.bz2 |
Don't assume resolved type has the same dex cache.
When we resolve a type with a certain DexCache that type's
GetDexCache() doesn't necessarily return the same DexCache.
This could have led to the wrong DexFile being used in
access checks by the CompilerDriver.
Change-Id: I2c836477f69f142bcbff902207dc0ad83854a398
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.h')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index f6e8ca3..a95fe12 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -311,8 +311,8 @@ static inline mirror::ArtField* FindFieldFromCode(uint32_t field_idx, const mirr return nullptr; } mirror::Class* referring_class = referrer->GetDeclaringClass(); - if (UNLIKELY(!referring_class->CanAccessResolvedField<true>(fields_class, resolved_field, - field_idx))) { + if (UNLIKELY(!referring_class->CheckResolvedFieldAccess(fields_class, resolved_field, + field_idx))) { DCHECK(self->IsExceptionPending()); // Throw exception and unwind. return nullptr; // Failure. } @@ -402,8 +402,8 @@ static inline mirror::ArtMethod* FindMethodFromCode(uint32_t method_idx, mirror: mirror::Class* methods_class = resolved_method->GetDeclaringClass(); mirror::Class* referring_class = referrer->GetDeclaringClass(); bool can_access_resolved_method = - referring_class->CanAccessResolvedMethod<true, type>(methods_class, resolved_method, - method_idx); + referring_class->CheckResolvedMethodAccess<type>(methods_class, resolved_method, + method_idx); if (UNLIKELY(!can_access_resolved_method)) { DCHECK(self->IsExceptionPending()); // Throw exception and unwind. return nullptr; // Failure. |