summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-07-30 18:59:05 -0700
committerAndreas Gampe <agampe@google.com>2014-07-30 20:38:55 -0700
commitaa910d5ef43256102809e397de305c23f1c315e6 (patch)
treeffd2bae0a66e2f174fabc4e8c1062038e5b5dccc /runtime/mirror
parentda4a1264cd7d5db9ed01cfd1eeaed71cb11c6c71 (diff)
downloadart-aa910d5ef43256102809e397de305c23f1c315e6.zip
art-aa910d5ef43256102809e397de305c23f1c315e6.tar.gz
art-aa910d5ef43256102809e397de305c23f1c315e6.tar.bz2
ART: Fix verifier mishandling erroneous array component types
The verifier must not assume that component types are not erroneous. Bug: 16661259 Change-Id: I23b2f517259ca9c0b8a1aa38f6348fcd61e0b22e
Diffstat (limited to 'runtime/mirror')
-rw-r--r--runtime/mirror/dex_cache-inl.h8
-rw-r--r--runtime/mirror/dex_cache.h7
2 files changed, 10 insertions, 5 deletions
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 08cff99..d3fcb55 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -19,6 +19,8 @@
#include "dex_cache.h"
+#include "base/logging.h"
+#include "mirror/class.h"
#include "runtime.h"
namespace art {
@@ -41,6 +43,12 @@ inline ArtMethod* DexCache::GetResolvedMethod(uint32_t method_idx)
}
}
+inline void DexCache::SetResolvedType(uint32_t type_idx, Class* resolved) {
+ // TODO default transaction support.
+ DCHECK(resolved == nullptr || !resolved->IsErroneous());
+ GetResolvedTypes()->Set(type_idx, resolved);
+}
+
} // namespace mirror
} // namespace art
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index bfd603a..2c5fbcd 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -103,11 +103,8 @@ class MANAGED DexCache FINAL : public Object {
return GetResolvedTypes()->Get(type_idx);
}
- void SetResolvedType(uint32_t type_idx, Class* resolved) ALWAYS_INLINE
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- // TODO default transaction support.
- GetResolvedTypes()->Set(type_idx, resolved);
- }
+ void SetResolvedType(uint32_t type_idx, Class* resolved)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
ArtMethod* GetResolvedMethod(uint32_t method_idx) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);