Skip to content

Commit 0d1df9d

Browse files
author
thk123
committed
Adding checks for the super class of the generated class
1 parent f1b4f98 commit 0d1df9d

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
@@ -106,7 +106,20 @@ void validate_lamdba_assignement(
106106
Catch::Matchers::Vector::ContainsElementMatcher<irep_idt>{
107107
tmp_class_identifier});
108108

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

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

0 commit comments

Comments
 (0)