| 2567 | } |
| 2568 | |
| 2569 | bool DexFileVerifier::CheckInterClassDataItem() { |
| 2570 | ClassDataItemIterator it(*dex_file_, ptr_); |
| 2571 | bool success; |
| 2572 | dex::TypeIndex defining_class = FindFirstClassDataDefiner(ptr_, &success); |
| 2573 | if (!success) { |
| 2574 | return false; |
| 2575 | } |
| 2576 | |
| 2577 | for (; it.HasNextStaticField() || it.HasNextInstanceField(); it.Next()) { |
| 2578 | LOAD_FIELD(field, it.GetMemberIndex(), "inter_class_data_item field_id", return false) |
| 2579 | if (UNLIKELY(field->class_idx_ != defining_class)) { |
| 2580 | ErrorStringPrintf("Mismatched defining class for class_data_item field"); |
| 2581 | return false; |
| 2582 | } |
| 2583 | } |
| 2584 | for (; it.HasNextMethod(); it.Next()) { |
| 2585 | uint32_t code_off = it.GetMethodCodeItemOffset(); |
| 2586 | if (code_off != 0 && !CheckOffsetToTypeMap(code_off, DexFile::kDexTypeCodeItem)) { |
| 2587 | return false; |
| 2588 | } |
| 2589 | LOAD_METHOD(method, it.GetMemberIndex(), "inter_class_data_item method_id", return false) |
| 2590 | if (UNLIKELY(method->class_idx_ != defining_class)) { |
| 2591 | ErrorStringPrintf("Mismatched defining class for class_data_item method"); |
| 2592 | return false; |
| 2593 | } |
| 2594 | } |
| 2595 | |
| 2596 | ptr_ = it.EndDataPointer(); |
| 2597 | return true; |
| 2598 | } |
| 2599 | |
| 2600 | bool DexFileVerifier::CheckInterAnnotationsDirectoryItem() { |
| 2601 | const DexFile::AnnotationsDirectoryItem* item = |
nothing calls this directly
no test coverage detected