Skip to content

Commit 54f1c54

Browse files
author
thk123
committed
Adding checks for the super class of the generated class
1 parent df895d3 commit 54f1c54

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,20 @@ void validate_lamdba_assignement(
105105
Catch::Matchers::Vector::ContainsElementMatcher<irep_idt>{
106106
tmp_class_identifier});
107107

108-
require_type::require_component(tmp_lambda_class_type, "@java.lang.Object");
108+
const java_class_typet::componentt super_class_component =
109+
require_type::require_component(tmp_lambda_class_type, "@java.lang.Object");
110+
111+
const symbol_typet &super_class_type = require_type::require_symbol(
112+
super_class_component.type(), "java::java.lang.Object");
113+
114+
const symbolt &base_class_symbol = require_symbol::require_symbol_exists(
115+
symbol_table, super_class_type.get_identifier());
116+
117+
REQUIRE(base_class_symbol.is_type);
118+
const class_typet &super_class_type_struct =
119+
require_type::require_incomplete_class(base_class_symbol.type);
120+
121+
require_type::require_component(super_class_type_struct, "@class_identifier");
109122
// TODO verify the components of the class have been set correctly
110123

111124
THEN("The function in the class should call the lambda method")

0 commit comments

Comments
 (0)