diff options
Diffstat (limited to 'dexlayout/dex_ir.cc')
-rw-r--r-- | dexlayout/dex_ir.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/dexlayout/dex_ir.cc b/dexlayout/dex_ir.cc index c3c763fee8..67f3e09567 100644 --- a/dexlayout/dex_ir.cc +++ b/dexlayout/dex_ir.cc @@ -319,7 +319,7 @@ void Collections::CreateStringId(const DexFile& dex_file, uint32_t i) { } void Collections::CreateTypeId(const DexFile& dex_file, uint32_t i) { - const DexFile::TypeId& disk_type_id = dex_file.GetTypeId(i); + const DexFile::TypeId& disk_type_id = dex_file.GetTypeId(dex::TypeIndex(i)); TypeId* type_id = new TypeId(GetStringId(disk_type_id.descriptor_idx_)); type_ids_.AddIndexedItem(type_id, TypeIdsOffset() + i * TypeId::ItemSize(), i); } @@ -330,22 +330,22 @@ void Collections::CreateProtoId(const DexFile& dex_file, uint32_t i) { TypeList* parameter_type_list = CreateTypeList(type_list, disk_proto_id.parameters_off_); ProtoId* proto_id = new ProtoId(GetStringId(disk_proto_id.shorty_idx_), - GetTypeId(disk_proto_id.return_type_idx_), + GetTypeId(disk_proto_id.return_type_idx_.index_), parameter_type_list); proto_ids_.AddIndexedItem(proto_id, ProtoIdsOffset() + i * ProtoId::ItemSize(), i); } void Collections::CreateFieldId(const DexFile& dex_file, uint32_t i) { const DexFile::FieldId& disk_field_id = dex_file.GetFieldId(i); - FieldId* field_id = new FieldId(GetTypeId(disk_field_id.class_idx_), - GetTypeId(disk_field_id.type_idx_), + FieldId* field_id = new FieldId(GetTypeId(disk_field_id.class_idx_.index_), + GetTypeId(disk_field_id.type_idx_.index_), GetStringId(disk_field_id.name_idx_)); field_ids_.AddIndexedItem(field_id, FieldIdsOffset() + i * FieldId::ItemSize(), i); } void Collections::CreateMethodId(const DexFile& dex_file, uint32_t i) { const DexFile::MethodId& disk_method_id = dex_file.GetMethodId(i); - MethodId* method_id = new MethodId(GetTypeId(disk_method_id.class_idx_), + MethodId* method_id = new MethodId(GetTypeId(disk_method_id.class_idx_.index_), GetProtoId(disk_method_id.proto_idx_), GetStringId(disk_method_id.name_idx_)); method_ids_.AddIndexedItem(method_id, MethodIdsOffset() + i * MethodId::ItemSize(), i); @@ -353,9 +353,9 @@ void Collections::CreateMethodId(const DexFile& dex_file, uint32_t i) { void Collections::CreateClassDef(const DexFile& dex_file, uint32_t i) { const DexFile::ClassDef& disk_class_def = dex_file.GetClassDef(i); - const TypeId* class_type = GetTypeId(disk_class_def.class_idx_); + const TypeId* class_type = GetTypeId(disk_class_def.class_idx_.index_); uint32_t access_flags = disk_class_def.access_flags_; - const TypeId* superclass = GetTypeIdOrNullPtr(disk_class_def.superclass_idx_); + const TypeId* superclass = GetTypeIdOrNullPtr(disk_class_def.superclass_idx_.index_); const DexFile::TypeList* type_list = dex_file.GetInterfacesList(disk_class_def); TypeList* interfaces_type_list = CreateTypeList(type_list, disk_class_def.interfaces_off_); @@ -393,7 +393,7 @@ TypeList* Collections::CreateTypeList(const DexFile::TypeList* dex_type_list, ui TypeIdVector* type_vector = new TypeIdVector(); uint32_t size = dex_type_list->Size(); for (uint32_t index = 0; index < size; ++index) { - type_vector->push_back(GetTypeId(dex_type_list->GetTypeItem(index).type_idx_)); + type_vector->push_back(GetTypeId(dex_type_list->GetTypeItem(index).type_idx_.index_)); } TypeList* new_type_list = new TypeList(type_vector); type_lists_.AddItem(new_type_list, offset); @@ -597,8 +597,8 @@ CodeItem* Collections::CreateCodeItem(const DexFile& dex_file, bool catch_all = false; TypeAddrPairVector* addr_pairs = new TypeAddrPairVector(); for (CatchHandlerIterator it(disk_code_item, *disk_try_item); it.HasNext(); it.Next()) { - const uint16_t type_index = it.GetHandlerTypeIndex(); - const TypeId* type_id = GetTypeIdOrNullPtr(type_index); + const dex::TypeIndex type_index = it.GetHandlerTypeIndex(); + const TypeId* type_id = GetTypeIdOrNullPtr(type_index.index_); catch_all |= type_id == nullptr; addr_pairs->push_back(std::unique_ptr<const TypeAddrPair>( new TypeAddrPair(type_id, it.GetHandlerAddress()))); |