Skip to content

Commit 574de4e

Browse files
author
Matthias Güdemann
committed
Use generic signature for local variables with entry in LVTT
1 parent 8863b9c commit 574de4e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

jbmc/src/java_bytecode/java_local_variable_table.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,16 @@ void java_bytecode_convert_methodt::setup_local_variables(
768768
<< " name " << v.var.name << " v.var.descriptor '"
769769
<< v.var.descriptor << "' holes " << v.holes.size() << eom;
770770
#endif
771-
typet t;
772-
// TODO: might need changing once descriptor/signature issue is resolved
773-
t=java_type_from_string(v.var.descriptor);
771+
772+
const std::string method_name = id2string(method_id);
773+
const size_t method_name_end = method_name.rfind(":(");
774+
const size_t class_name_end = method_name.rfind('.', method_name_end);
775+
const std::string class_name = method_name.substr(0, class_name_end);
776+
777+
const typet t = v.var.signature.has_value()
778+
? java_type_from_string_with_exception(
779+
v.var.descriptor, v.var.signature, class_name)
780+
: java_type_from_string(v.var.descriptor);
774781

775782
std::ostringstream id_oss;
776783
id_oss << method_id << "::" << v.var.start_pc << "::" << v.var.name;

0 commit comments

Comments
 (0)