summaryrefslogtreecommitdiff
path: root/src/class_linker.cc
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2012-04-14 11:46:01 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-04-14 11:46:01 -0700
commit42f302c1da4cf1abf935d7aee29ece8d90441e0c (patch)
tree1313bbbf93b2983e4046c5eaf023c48377e7fb9a /src/class_linker.cc
parent33687790adbb889abdd95bb22914acb57ce6e68c (diff)
parenta0e180632411f7fe0edf454e571c42209ee7b540 (diff)
Merge "Add a SafeMap equivalent to std::map but without the error-prone operator[]." into ics-mr1-plus-art
Diffstat (limited to 'src/class_linker.cc')
-rw-r--r--src/class_linker.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 567415c431..423bd72a5e 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -2674,12 +2674,12 @@ bool ClassLinker::EnsureInitialized(Class* c, bool can_run_clinit, bool can_init
}
void ClassLinker::ConstructFieldMap(const DexFile& dex_file, const DexFile::ClassDef& dex_class_def,
- Class* c, std::map<uint32_t, Field*>& field_map) {
+ Class* c, SafeMap<uint32_t, Field*>& field_map) {
const ClassLoader* cl = c->GetClassLoader();
const byte* class_data = dex_file.GetClassData(dex_class_def);
ClassDataItemIterator it(dex_file, class_data);
for (size_t i = 0; it.HasNextStaticField(); i++, it.Next()) {
- field_map[i] = ResolveField(dex_file, it.GetMemberIndex(), c->GetDexCache(), cl, true);
+ field_map.Put(i, ResolveField(dex_file, it.GetMemberIndex(), c->GetDexCache(), cl, true));
}
}
@@ -2701,10 +2701,10 @@ bool ClassLinker::InitializeStaticFields(Class* klass) {
if (it.HasNext()) {
// We reordered the fields, so we need to be able to map the field indexes to the right fields.
- std::map<uint32_t, Field*> field_map;
+ SafeMap<uint32_t, Field*> field_map;
ConstructFieldMap(dex_file, *dex_class_def, klass, field_map);
for (size_t i = 0; it.HasNext(); i++, it.Next()) {
- it.ReadValueToField(field_map[i]);
+ it.ReadValueToField(field_map.Get(i));
}
return true;
}