@@ -586,7 +586,8 @@ static symbol_exprt instantiate_new_object(
586586 " REF_NewInvokeSpecial lambda must refer to a constructor" );
587587 const auto &created_type = method_type.parameters ().at (0 ).type ();
588588 irep_idt created_class =
589- to_struct_tag_type (created_type.subtype ()).get_identifier ();
589+ to_struct_tag_type (to_reference_type (created_type).base_type ())
590+ .get_identifier ();
590591
591592 // Call static init if it exists:
592593 irep_idt static_init_name = clinit_wrapper_name (created_class);
@@ -612,10 +613,11 @@ static symbol_exprt instantiate_new_object(
612613
613614// / If \p maybe_boxed_type is a boxed primitive return its unboxing method;
614615// / otherwise return empty.
615- static optionalt<irep_idt> get_unboxing_method (const typet &maybe_boxed_type)
616+ static optionalt<irep_idt>
617+ get_unboxing_method (const pointer_typet &maybe_boxed_type)
616618{
617619 const irep_idt &boxed_type_id =
618- to_struct_tag_type (maybe_boxed_type.subtype ()).get_identifier ();
620+ to_struct_tag_type (maybe_boxed_type.base_type ()).get_identifier ();
619621 const java_boxed_type_infot *boxed_type_info =
620622 get_boxed_type_info_by_name (boxed_type_id);
621623 return boxed_type_info ? boxed_type_info->unboxing_function_name
@@ -633,7 +635,8 @@ exprt make_function_expr(
633635 if (!method_type.has_this ())
634636 return function_symbol.symbol_expr ();
635637 const irep_idt &declared_on_class_id =
636- to_struct_tag_type (method_type.get_this ()->type ().subtype ())
638+ to_struct_tag_type (
639+ to_pointer_type (method_type.get_this ()->type ()).base_type ())
637640 .get_identifier ();
638641 const auto &this_symbol = symbol_table.lookup_ref (declared_on_class_id);
639642 if (to_java_class_type (this_symbol.type ).get_final ())
@@ -717,7 +720,8 @@ exprt box_or_unbox_type_if_necessary(
717720
718721 const irep_idt transform_function_id =
719722 original_is_pointer
720- ? get_unboxing_method (original_type) // Use static type if known
723+ ? get_unboxing_method (
724+ to_pointer_type (original_type)) // Use static type if known
721725 .value_or (primitive_type_info->unboxing_function_name )
722726 : primitive_type_info->boxed_type_factory_method ;
723727
0 commit comments