Lines Matching refs:item
397 DexMapItem* item = pMap->list; in swapMap() local
408 CHECK_LIST_SIZE(item, count, sizeof(DexMapItem)); in swapMap()
411 SWAP_FIELD2(item->type); in swapMap()
412 SWAP_FIELD2(item->unused); in swapMap()
413 SWAP_FIELD4(item->size); in swapMap()
414 SWAP_OFFSET4(item->offset); in swapMap()
418 } else if (lastOffset >= item->offset) { in swapMap()
420 lastOffset, item->offset); in swapMap()
424 if (item->offset >= state->pHeader->fileSize) { in swapMap()
426 item->offset, state->pHeader->fileSize); in swapMap()
430 if (isDataSectionType(item->type)) { in swapMap()
431 u4 icount = item->size; in swapMap()
448 u4 bit = mapTypeToBitMask(item->type); in swapMap()
455 ALOGE("Duplicate map section of type %#x", item->type); in swapMap()
460 lastOffset = item->offset; in swapMap()
461 item++; in swapMap()
548 DexStringId* item = (DexStringId*) ptr; in swapStringIdItem() local
550 CHECK_PTR_RANGE(item, item + 1); in swapStringIdItem()
551 SWAP_OFFSET4(item->stringDataOff); in swapStringIdItem()
553 return item + 1; in swapStringIdItem()
558 const DexStringId* item = (const DexStringId*) ptr; in crossVerifyStringIdItem() local
561 item->stringDataOff, kDexTypeStringDataItem)) { in crossVerifyStringIdItem()
569 const char* s1 = dexGetStringData(state->pDexFile, item); in crossVerifyStringIdItem()
576 return (void*) (item + 1); in crossVerifyStringIdItem()
581 DexTypeId* item = (DexTypeId*) ptr; in swapTypeIdItem() local
583 CHECK_PTR_RANGE(item, item + 1); in swapTypeIdItem()
584 SWAP_INDEX4(item->descriptorIdx, state->pHeader->stringIdsSize); in swapTypeIdItem()
586 return item + 1; in swapTypeIdItem()
591 const DexTypeId* item = (const DexTypeId*) ptr; in crossVerifyTypeIdItem() local
593 dexStringById(state->pDexFile, item->descriptorIdx); in crossVerifyTypeIdItem()
603 if (item0->descriptorIdx >= item->descriptorIdx) { in crossVerifyTypeIdItem()
605 item0->descriptorIdx, item->descriptorIdx); in crossVerifyTypeIdItem()
610 return (void*) (item + 1); in crossVerifyTypeIdItem()
615 DexProtoId* item = (DexProtoId*) ptr; in swapProtoIdItem() local
617 CHECK_PTR_RANGE(item, item + 1); in swapProtoIdItem()
618 SWAP_INDEX4(item->shortyIdx, state->pHeader->stringIdsSize); in swapProtoIdItem()
619 SWAP_INDEX4(item->returnTypeIdx, state->pHeader->typeIdsSize); in swapProtoIdItem()
620 SWAP_OFFSET4(item->parametersOff); in swapProtoIdItem()
622 return item + 1; in swapProtoIdItem()
672 const DexProtoId* item = (const DexProtoId*) ptr; in crossVerifyProtoIdItem() local
674 dexStringById(state->pDexFile, item->shortyIdx); in crossVerifyProtoIdItem()
677 item->parametersOff, kDexTypeTypeList)) { in crossVerifyProtoIdItem()
682 dexStringByTypeIdx(state->pDexFile, item->returnTypeIdx), in crossVerifyProtoIdItem()
687 u4 protoIdx = item - state->pDexFile->pProtoIds; in crossVerifyProtoIdItem()
721 if (item0->returnTypeIdx > item->returnTypeIdx) { in crossVerifyProtoIdItem()
724 } else if (item0->returnTypeIdx == item->returnTypeIdx) { in crossVerifyProtoIdItem()
760 return (void*) (item + 1); in crossVerifyProtoIdItem()
765 DexFieldId* item = (DexFieldId*) ptr; in swapFieldIdItem() local
767 CHECK_PTR_RANGE(item, item + 1); in swapFieldIdItem()
768 SWAP_INDEX2(item->classIdx, state->pHeader->typeIdsSize); in swapFieldIdItem()
769 SWAP_INDEX2(item->typeIdx, state->pHeader->typeIdsSize); in swapFieldIdItem()
770 SWAP_INDEX4(item->nameIdx, state->pHeader->stringIdsSize); in swapFieldIdItem()
772 return item + 1; in swapFieldIdItem()
777 const DexFieldId* item = (const DexFieldId*) ptr; in crossVerifyFieldIdItem() local
780 s = dexStringByTypeIdx(state->pDexFile, item->classIdx); in crossVerifyFieldIdItem()
786 s = dexStringByTypeIdx(state->pDexFile, item->typeIdx); in crossVerifyFieldIdItem()
792 s = dexStringById(state->pDexFile, item->nameIdx); in crossVerifyFieldIdItem()
804 if (item0->classIdx > item->classIdx) { in crossVerifyFieldIdItem()
807 } else if (item0->classIdx < item->classIdx) { in crossVerifyFieldIdItem()
812 if (item0->nameIdx > item->nameIdx) { in crossVerifyFieldIdItem()
815 } else if (item0->nameIdx < item->nameIdx) { in crossVerifyFieldIdItem()
821 if (item0->typeIdx >= item->typeIdx) { in crossVerifyFieldIdItem()
832 return (void*) (item + 1); in crossVerifyFieldIdItem()
837 DexMethodId* item = (DexMethodId*) ptr; in swapMethodIdItem() local
839 CHECK_PTR_RANGE(item, item + 1); in swapMethodIdItem()
840 SWAP_INDEX2(item->classIdx, state->pHeader->typeIdsSize); in swapMethodIdItem()
841 SWAP_INDEX2(item->protoIdx, state->pHeader->protoIdsSize); in swapMethodIdItem()
842 SWAP_INDEX4(item->nameIdx, state->pHeader->stringIdsSize); in swapMethodIdItem()
844 return item + 1; in swapMethodIdItem()
849 const DexMethodId* item = (const DexMethodId*) ptr; in crossVerifyMethodIdItem() local
852 s = dexStringByTypeIdx(state->pDexFile, item->classIdx); in crossVerifyMethodIdItem()
858 s = dexStringById(state->pDexFile, item->nameIdx); in crossVerifyMethodIdItem()
870 if (item0->classIdx > item->classIdx) { in crossVerifyMethodIdItem()
873 } else if (item0->classIdx < item->classIdx) { in crossVerifyMethodIdItem()
878 if (item0->nameIdx > item->nameIdx) { in crossVerifyMethodIdItem()
881 } else if (item0->nameIdx < item->nameIdx) { in crossVerifyMethodIdItem()
887 if (item0->protoIdx >= item->protoIdx) { in crossVerifyMethodIdItem()
898 return (void*) (item + 1); in crossVerifyMethodIdItem()
903 DexClassDef* item = (DexClassDef*) ptr; in swapClassDefItem() local
905 CHECK_PTR_RANGE(item, item + 1); in swapClassDefItem()
906 SWAP_INDEX4(item->classIdx, state->pHeader->typeIdsSize); in swapClassDefItem()
907 SWAP_FIELD4(item->accessFlags); in swapClassDefItem()
908 SWAP_INDEX4_OR_NOINDEX(item->superclassIdx, state->pHeader->typeIdsSize); in swapClassDefItem()
909 SWAP_OFFSET4(item->interfacesOff); in swapClassDefItem()
910 SWAP_INDEX4_OR_NOINDEX(item->sourceFileIdx, state->pHeader->stringIdsSize); in swapClassDefItem()
911 SWAP_OFFSET4(item->annotationsOff); in swapClassDefItem()
912 SWAP_OFFSET4(item->classDataOff); in swapClassDefItem()
914 return item + 1; in swapClassDefItem()
969 const DexClassDef* item = (const DexClassDef*) ptr; in crossVerifyClassDefItem() local
970 u4 classIdx = item->classIdx; in crossVerifyClassDefItem()
985 item->interfacesOff, kDexTypeTypeList) in crossVerifyClassDefItem()
987 item->annotationsOff, kDexTypeAnnotationsDirectoryItem) in crossVerifyClassDefItem()
989 item->classDataOff, kDexTypeClassDataItem) in crossVerifyClassDefItem()
991 item->staticValuesOff, kDexTypeEncodedArrayItem); in crossVerifyClassDefItem()
997 if (item->superclassIdx != kDexNoIndex) { in crossVerifyClassDefItem()
998 descriptor = dexStringByTypeIdx(state->pDexFile, item->superclassIdx); in crossVerifyClassDefItem()
1006 dexGetInterfacesList(state->pDexFile, item); in crossVerifyClassDefItem()
1045 if (!verifyClassDataIsForDef(state, item->classDataOff, item->classIdx)) { in crossVerifyClassDefItem()
1050 if (!verifyAnnotationsDirectoryIsForDef(state, item->annotationsOff, in crossVerifyClassDefItem()
1051 item->classIdx)) { in crossVerifyClassDefItem()
1056 return (void*) (item + 1); in crossVerifyClassDefItem()
1063 DexFieldAnnotationsItem* item = (DexFieldAnnotationsItem*) addr; in swapFieldAnnotations() local
1067 CHECK_LIST_SIZE(item, count, sizeof(DexFieldAnnotationsItem)); in swapFieldAnnotations()
1070 SWAP_INDEX4(item->fieldIdx, state->pHeader->fieldIdsSize); in swapFieldAnnotations()
1071 SWAP_OFFSET4(item->annotationsOff); in swapFieldAnnotations()
1075 } else if (lastIdx >= item->fieldIdx) { in swapFieldAnnotations()
1077 item->fieldIdx); in swapFieldAnnotations()
1081 lastIdx = item->fieldIdx; in swapFieldAnnotations()
1082 item++; in swapFieldAnnotations()
1085 return (u1*) item; in swapFieldAnnotations()
1092 DexMethodAnnotationsItem* item = (DexMethodAnnotationsItem*) addr; in swapMethodAnnotations() local
1096 CHECK_LIST_SIZE(item, count, sizeof(DexMethodAnnotationsItem)); in swapMethodAnnotations()
1099 SWAP_INDEX4(item->methodIdx, state->pHeader->methodIdsSize); in swapMethodAnnotations()
1100 SWAP_OFFSET4(item->annotationsOff); in swapMethodAnnotations()
1104 } else if (lastIdx >= item->methodIdx) { in swapMethodAnnotations()
1106 item->methodIdx); in swapMethodAnnotations()
1110 lastIdx = item->methodIdx; in swapMethodAnnotations()
1111 item++; in swapMethodAnnotations()
1114 return (u1*) item; in swapMethodAnnotations()
1122 DexParameterAnnotationsItem* item = (DexParameterAnnotationsItem*) addr; in swapParameterAnnotations() local
1126 CHECK_LIST_SIZE(item, count, sizeof(DexParameterAnnotationsItem)); in swapParameterAnnotations()
1129 SWAP_INDEX4(item->methodIdx, state->pHeader->methodIdsSize); in swapParameterAnnotations()
1130 SWAP_OFFSET4(item->annotationsOff); in swapParameterAnnotations()
1134 } else if (lastIdx >= item->methodIdx) { in swapParameterAnnotations()
1136 item->methodIdx); in swapParameterAnnotations()
1140 lastIdx = item->methodIdx; in swapParameterAnnotations()
1141 item++; in swapParameterAnnotations()
1144 return (u1*) item; in swapParameterAnnotations()
1150 DexAnnotationsDirectoryItem* item = (DexAnnotationsDirectoryItem*) ptr; in swapAnnotationsDirectoryItem() local
1152 CHECK_PTR_RANGE(item, item + 1); in swapAnnotationsDirectoryItem()
1153 SWAP_OFFSET4(item->classAnnotationsOff); in swapAnnotationsDirectoryItem()
1154 SWAP_FIELD4(item->fieldsSize); in swapAnnotationsDirectoryItem()
1155 SWAP_FIELD4(item->methodsSize); in swapAnnotationsDirectoryItem()
1156 SWAP_FIELD4(item->parametersSize); in swapAnnotationsDirectoryItem()
1158 u1* addr = (u1*) (item + 1); in swapAnnotationsDirectoryItem()
1160 if (item->fieldsSize != 0) { in swapAnnotationsDirectoryItem()
1161 addr = swapFieldAnnotations(state, item->fieldsSize, addr); in swapAnnotationsDirectoryItem()
1167 if (item->methodsSize != 0) { in swapAnnotationsDirectoryItem()
1168 addr = swapMethodAnnotations(state, item->methodsSize, addr); in swapAnnotationsDirectoryItem()
1174 if (item->parametersSize != 0) { in swapAnnotationsDirectoryItem()
1175 addr = swapParameterAnnotations(state, item->parametersSize, addr); in swapAnnotationsDirectoryItem()
1188 const DexFieldAnnotationsItem* item = (DexFieldAnnotationsItem*) addr; in crossVerifyFieldAnnotations() local
1191 if (!verifyFieldDefiner(state, definingClass, item->fieldIdx)) { in crossVerifyFieldAnnotations()
1194 if (!dexDataMapVerify(state->pDataMap, item->annotationsOff, in crossVerifyFieldAnnotations()
1198 item++; in crossVerifyFieldAnnotations()
1201 return (const u1*) item; in crossVerifyFieldAnnotations()
1208 const DexMethodAnnotationsItem* item = (DexMethodAnnotationsItem*) addr; in crossVerifyMethodAnnotations() local
1211 if (!verifyMethodDefiner(state, definingClass, item->methodIdx)) { in crossVerifyMethodAnnotations()
1214 if (!dexDataMapVerify(state->pDataMap, item->annotationsOff, in crossVerifyMethodAnnotations()
1218 item++; in crossVerifyMethodAnnotations()
1221 return (const u1*) item; in crossVerifyMethodAnnotations()
1228 const DexParameterAnnotationsItem* item = in crossVerifyParameterAnnotations() local
1232 if (!verifyMethodDefiner(state, definingClass, item->methodIdx)) { in crossVerifyParameterAnnotations()
1235 if (!dexDataMapVerify(state->pDataMap, item->annotationsOff, in crossVerifyParameterAnnotations()
1239 item++; in crossVerifyParameterAnnotations()
1242 return (const u1*) item; in crossVerifyParameterAnnotations()
1280 const DexAnnotationsDirectoryItem* item = (const DexAnnotationsDirectoryItem*) ptr; in crossVerifyAnnotationsDirectoryItem() local
1281 u4 definingClass = findFirstAnnotationsDirectoryDefiner(state, item); in crossVerifyAnnotationsDirectoryItem()
1284 item->classAnnotationsOff, kDexTypeAnnotationSetItem)) { in crossVerifyAnnotationsDirectoryItem()
1288 const u1* addr = (const u1*) (item + 1); in crossVerifyAnnotationsDirectoryItem()
1290 if (item->fieldsSize != 0) { in crossVerifyAnnotationsDirectoryItem()
1291 addr = crossVerifyFieldAnnotations(state, item->fieldsSize, addr, in crossVerifyAnnotationsDirectoryItem()
1298 if (item->methodsSize != 0) { in crossVerifyAnnotationsDirectoryItem()
1299 addr = crossVerifyMethodAnnotations(state, item->methodsSize, addr, in crossVerifyAnnotationsDirectoryItem()
1306 if (item->parametersSize != 0) { in crossVerifyAnnotationsDirectoryItem()
1307 addr = crossVerifyParameterAnnotations(state, item->parametersSize, in crossVerifyAnnotationsDirectoryItem()
1342 DexAnnotationSetRefItem* item; in swapAnnotationSetRefList() local
1348 item = list->list; in swapAnnotationSetRefList()
1349 CHECK_LIST_SIZE(item, count, sizeof(DexAnnotationSetRefItem)); in swapAnnotationSetRefList()
1352 SWAP_OFFSET4(item->annotationsOff); in swapAnnotationSetRefList()
1353 item++; in swapAnnotationSetRefList()
1356 return item; in swapAnnotationSetRefList()
1363 const DexAnnotationSetRefItem* item = list->list; in crossVerifyAnnotationSetRefList() local
1368 item->annotationsOff, kDexTypeAnnotationSetItem)) { in crossVerifyAnnotationSetRefList()
1371 item++; in crossVerifyAnnotationSetRefList()
1374 return (void*) item; in crossVerifyAnnotationSetRefList()
1381 u4* item; in swapAnnotationSetItem() local
1387 item = set->entries; in swapAnnotationSetItem()
1388 CHECK_LIST_SIZE(item, count, sizeof(u4)); in swapAnnotationSetItem()
1391 SWAP_OFFSET4(*item); in swapAnnotationSetItem()
1392 item++; in swapAnnotationSetItem()
1395 return item; in swapAnnotationSetItem()
1400 static u4 annotationItemTypeIdx(const DexAnnotationItem* item) { in annotationItemTypeIdx() argument
1401 const u1* data = item->annotation; in annotationItemTypeIdx()
1802 DexCode* item = (DexCode*) ptr; in swapCodeItem() local
1806 CHECK_PTR_RANGE(item, item + 1); in swapCodeItem()
1807 SWAP_FIELD2(item->registersSize); in swapCodeItem()
1808 SWAP_FIELD2(item->insSize); in swapCodeItem()
1809 SWAP_FIELD2(item->outsSize); in swapCodeItem()
1810 SWAP_FIELD2(item->triesSize); in swapCodeItem()
1811 SWAP_OFFSET4(item->debugInfoOff); in swapCodeItem()
1812 SWAP_FIELD4(item->insnsSize); in swapCodeItem()
1814 if (item->insSize > item->registersSize) { in swapCodeItem()
1815 ALOGE("insSize (%u) > registersSize (%u)", item->insSize, in swapCodeItem()
1816 item->registersSize); in swapCodeItem()
1820 if ((item->outsSize > 5) && (item->outsSize > item->registersSize)) { in swapCodeItem()
1828 ALOGE("outsSize (%u) > registersSize (%u)", item->outsSize, in swapCodeItem()
1829 item->registersSize); in swapCodeItem()
1833 count = item->insnsSize; in swapCodeItem()
1834 insns = item->insns; in swapCodeItem()
1842 if (item->triesSize == 0) { in swapCodeItem()
1853 ptr = swapTriesAndCatches(state, item); in swapCodeItem()
2515 const DexMapItem* item = pMap->list; in swapEverythingButHeaderAndMap() local
2521 u4 sectionOffset = item->offset; in swapEverythingButHeaderAndMap()
2522 u4 sectionCount = item->size; in swapEverythingButHeaderAndMap()
2523 u2 type = item->type; in swapEverythingButHeaderAndMap()
2676 item++; in swapEverythingButHeaderAndMap()
2689 const DexMapItem* item = pMap->list; in crossVerifyEverything() local
2694 u4 sectionOffset = item->offset; in crossVerifyEverything()
2695 u4 sectionCount = item->size; in crossVerifyEverything()
2697 switch (item->type) { in crossVerifyEverything()
2768 ALOGE("Unknown map item type %04x", item->type); in crossVerifyEverything()
2775 item->type); in crossVerifyEverything()
2778 item++; in crossVerifyEverything()