@@ -324,14 +324,15 @@ optionalt<symbolt> java_bytecode_convert_methodt::get_lambda_method_symbol(
324
324
// / This creates a method symbol in the symtab, but doesn't actually perform
325
325
// / method conversion just yet. The caller should call
326
326
// / java_bytecode_convert_method later to give the symbol/method a body.
327
- // / \param class_symbol: The class this method belongs to
327
+ // / \param class_symbol: The class this method belongs to. The method, if not
328
+ // / static, will be added to the class' list of methods.
328
329
// / \param method_identifier: The fully qualified method name, including type
329
330
// / descriptor (e.g. "x.y.z.f:(I)")
330
331
// / \param m: The parsed method object to convert.
331
332
// / \param symbol_table: The global symbol table (will be modified).
332
333
// / \param message_handler: A message handler to collect warnings.
333
334
void java_bytecode_convert_method_lazy (
334
- const symbolt &class_symbol,
335
+ symbolt &class_symbol,
335
336
const irep_idt &method_identifier,
336
337
const java_bytecode_parse_treet::methodt &m,
337
338
symbol_tablet &symbol_table,
@@ -423,6 +424,19 @@ void java_bytecode_convert_method_lazy(
423
424
}
424
425
425
426
symbol_table.add (method_symbol);
427
+
428
+ if (!m.is_static )
429
+ {
430
+ class_typet::methodt new_method;
431
+ new_method.set_name (method_symbol.name );
432
+ new_method.set_base_name (method_symbol.base_name );
433
+ new_method.set_pretty_name (method_symbol.pretty_name );
434
+ new_method.set_access (member_type.get_access ());
435
+ new_method.type () = method_symbol.type ;
436
+
437
+ to_class_type (class_symbol.type ).methods ().emplace_back (
438
+ std::move (new_method));
439
+ }
426
440
}
427
441
428
442
static irep_idt get_method_identifier (
0 commit comments