Skip to content

Commit ba971c0

Browse files
committed
Fix missing declaring class of opaque methods
1 parent 242bb0f commit ba971c0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,7 @@ void java_bytecode_convert_methodt::convert_invoke(
22072207
symbol.mode = ID_java;
22082208
assign_parameter_names(
22092209
to_java_method_type(symbol.type), symbol.name, symbol_table);
2210+
set_declaring_class(symbol, arg0.get(ID_C_class));
22102211

22112212
debug() << "Generating codet: new opaque symbol: method '" << symbol.name
22122213
<< "'" << eom;

jbmc/unit/java_bytecode/java_bytecode_convert_method/convert_method.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ Author: Diffblue Limited.
88

99
#include <testing-utils/use_catch.h>
1010

11+
#include <util/irep.h>
1112
#include <util/symbol_table.h>
1213

1314
#include <java-testing-utils/load_java_class.h>
1415
#include <java-testing-utils/require_type.h>
1516

17+
#include <java_bytecode/java_utils.h>
18+
1619
SCENARIO(
1720
"java_bytecode_convert_bridge_method",
1821
"[core][java_bytecode][java_bytecode_convert_method]")
@@ -138,6 +141,11 @@ SCENARIO(
138141
{
139142
REQUIRE(function_type.get_is_final());
140143
}
144+
THEN("The method should be marked as declared by its class")
145+
{
146+
REQUIRE(
147+
id2string(*declaring_class(function_symbol)) == "java::OpaqueClass");
148+
}
141149
}
142150
}
143151
}

0 commit comments

Comments
 (0)