Skip to content

Commit

Permalink
Sharpen support relaxed inits in definitely-assigned-ifields analysis
Browse files Browse the repository at this point in the history
Summary: D56045539 was overly conservative; we only need to consider <init> calls when there's a type mismatch in the first argument.

Reviewed By: wsanville

Differential Revision: D56089271

fbshipit-source-id: 46fc489f359e507cb419731aa9d47bd4f57cb297
  • Loading branch information
Nikolai Tillmann authored and facebook-github-bot committed Apr 15, 2024
1 parent 77bf02c commit cabf694
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion service/constant-propagation/DefinitelyAssignedIFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ std::unordered_set<const DexField*> get_definitely_assigned_ifields(
always_assert(opcode::is_new_instance(def->opcode()));
for (auto& use : uses) {
if (opcode::is_invoke_direct(use.insn->opcode()) &&
method::is_init(use.insn->get_method())) {
use.src_index == 0 && method::is_init(use.insn->get_method())) {
auto resolved =
resolve_method(use.insn->get_method(), MethodSearch::Direct);
if (resolved == nullptr || resolved->get_class() != def->get_type()) {
Expand Down

0 comments on commit cabf694

Please sign in to comment.