Skip to content

Commit 5009cbb

Browse files
committed
CI lazy methods: re-explore array types with different element types
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.
1 parent f17e2c8 commit 5009cbb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/java_bytecode/ci_lazy_methods.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,10 @@ void ci_lazy_methodst::initialize_needed_classes_from_pointer(
344344
const symbol_typet &class_type=to_symbol_type(pointer_type.subtype());
345345
const auto &param_classid=class_type.get_identifier();
346346

347-
if(needed_lazy_methods.add_needed_class(param_classid))
347+
// Note here: different arrays may have different element types, so we should
348+
// explore again even if we've seen this classid before in the array case.
349+
if(needed_lazy_methods.add_needed_class(param_classid) ||
350+
is_java_array_tag(param_classid))
348351
{
349352
gather_field_types(pointer_type.subtype(), ns, needed_lazy_methods);
350353
}

0 commit comments

Comments
 (0)