Skip to content

Commit 409d892

Browse files
author
thk123
committed
Don't forcibly instantiate abstract classes
If a class is abstract then there definitely isn't an instance of it so we shouldn't load those methods.
1 parent a718893 commit 409d892

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jbmc/src/java_bytecode/ci_lazy_methods_needed.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ void ci_lazy_methods_neededt::add_all_needed_classes(
5252
const pointer_typet &pointer_type)
5353
{
5454
namespacet ns{symbol_table};
55+
const java_class_typet &underlying_type =
56+
to_java_class_type(ns.follow(pointer_type.subtype()));
57+
58+
if(underlying_type.is_abstract())
59+
return;
60+
5561
initialize_instantiated_classes_from_pointer(pointer_type, ns);
5662

5763
// TODO we should be passing here a map that maps generic parameters

0 commit comments

Comments
 (0)