Skip to content

Commit

Permalink
CI lazy methods: re-explore array types with different element types
Browse files Browse the repository at this point in the history
Previously upon encountering a second array this would truncate the search for
available types, but since they may have different element types this could lead
to missing the availability of one or more of the element classes. Now we search
array::reference every time we encounter it.
  • Loading branch information
smowton committed Jan 29, 2018
1 parent f17e2c8 commit 5009cbb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/java_bytecode/ci_lazy_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ void ci_lazy_methodst::initialize_needed_classes_from_pointer(
const symbol_typet &class_type=to_symbol_type(pointer_type.subtype());
const auto &param_classid=class_type.get_identifier();

if(needed_lazy_methods.add_needed_class(param_classid))
// Note here: different arrays may have different element types, so we should
// explore again even if we've seen this classid before in the array case.
if(needed_lazy_methods.add_needed_class(param_classid) ||
is_java_array_tag(param_classid))
{
gather_field_types(pointer_type.subtype(), ns, needed_lazy_methods);
}
Expand Down

0 comments on commit 5009cbb

Please sign in to comment.