Skip to content

Commit

Permalink
Use the old resolve method API in TypedefAnnoCheckerPass
Browse files Browse the repository at this point in the history
Summary: Use the old resolve method API in TypedefAnnoCheckerPass so I can promote the pass to staging and stable without pulling in all the dependent diffs on the new API in D49440605. Once it gets promoted to stable, the checker will switch back to the new API

Reviewed By: thezhangwei

Differential Revision: D50338552

fbshipit-source-id: b9801cf7dbc4e3d681d6e7c40a026d131e229c4c
  • Loading branch information
itang00 authored and facebook-github-bot committed Oct 17, 2023
1 parent 25e6135 commit f53b62a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions opt/typedef-anno-checker/TypedefAnnoCheckerPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ void TypedefAnnoChecker::check_instruction(
case OPCODE_INVOKE_DIRECT:
case OPCODE_INVOKE_STATIC:
case OPCODE_INVOKE_INTERFACE: {
DexMethodRef* ref_method = insn->get_method();
bool resolved_virtual_to_interface;
auto def_method =
resolve_invoke_method(insn, m, &resolved_virtual_to_interface);
resolve_method(insn->get_method(), opcode_to_search(insn), m);
if (def_method == nullptr && opcode == OPCODE_INVOKE_VIRTUAL) {
def_method =
resolve_method(insn->get_method(), MethodSearch::InterfaceVirtual);
}
if (!def_method) {
return;
}
Expand Down Expand Up @@ -340,9 +342,12 @@ bool TypedefAnnoChecker::check_typedef_value(
case OPCODE_INVOKE_DIRECT:
case OPCODE_INVOKE_STATIC:
case OPCODE_INVOKE_INTERFACE: {
bool resolved_virtual_to_interface;
auto def_method =
resolve_invoke_method(def, m, &resolved_virtual_to_interface);
resolve_method(def->get_method(), opcode_to_search(def), m);
if (def_method == nullptr && def->opcode() == OPCODE_INVOKE_VIRTUAL) {
def_method =
resolve_method(def->get_method(), MethodSearch::InterfaceVirtual);
}
if (!def_method) {
std::ostringstream out;
out << "TypedefAnnoCheckerPass: in the method " << SHOW(m)
Expand Down

0 comments on commit f53b62a

Please sign in to comment.