MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / CheckInterMethodHandleItem

Method CheckInterMethodHandleItem

Bcore/src/main/cpp/dex/dex_file_verifier.cc:2488–2519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2486}
2487
2488bool DexFileVerifier::CheckInterMethodHandleItem() {
2489 const DexFile::MethodHandleItem* item = reinterpret_cast<const DexFile::MethodHandleItem*>(ptr_);
2490
2491 DexFile::MethodHandleType method_handle_type =
2492 static_cast<DexFile::MethodHandleType>(item->method_handle_type_);
2493 if (method_handle_type > DexFile::MethodHandleType::kLast) {
2494 ErrorStringPrintf("Bad method handle type %x", item->method_handle_type_);
2495 return false;
2496 }
2497
2498 uint32_t index = item->field_or_method_idx_;
2499 switch (method_handle_type) {
2500 case DexFile::MethodHandleType::kStaticPut:
2501 case DexFile::MethodHandleType::kStaticGet:
2502 case DexFile::MethodHandleType::kInstancePut:
2503 case DexFile::MethodHandleType::kInstanceGet: {
2504 LOAD_FIELD(field, index, "method_handle_item field_idx", return false);
2505 break;
2506 }
2507 case DexFile::MethodHandleType::kInvokeStatic:
2508 case DexFile::MethodHandleType::kInvokeInstance:
2509 case DexFile::MethodHandleType::kInvokeConstructor:
2510 case DexFile::MethodHandleType::kInvokeDirect:
2511 case DexFile::MethodHandleType::kInvokeInterface: {
2512 LOAD_METHOD(method, index, "method_handle_item method_idx", return false);
2513 break;
2514 }
2515 }
2516
2517 ptr_ += sizeof(DexFile::MethodHandleItem);
2518 return true;
2519}
2520
2521bool DexFileVerifier::CheckInterAnnotationSetRefList() {
2522 const DexFile::AnnotationSetRefList* list =

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected