@@ -317,23 +317,13 @@ static size_t get_variable_slots(const code_typet::parametert ¶m)
317
317
return count_slots (0 , param);
318
318
}
319
319
320
- static bool is_constructor (const class_typet::methodt &method)
320
+ bool is_constructor (const class_typet::methodt &method)
321
321
{
322
322
const std::string &name (id2string (method.get_name ()));
323
323
const std::string::size_type &npos (std::string::npos);
324
324
return npos!=name.find (" <init>" ) || npos!=name.find (" <clinit>" );
325
325
}
326
326
327
- static void cast_if_necessary (binary_relation_exprt &condition)
328
- {
329
- exprt &lhs (condition.lhs ());
330
- exprt &rhs (condition.rhs ());
331
- const typet &lhs_type (lhs.type ());
332
- if (lhs_type==rhs.type ())
333
- return ;
334
- rhs=typecast_exprt (rhs, lhs_type);
335
- }
336
-
337
327
static irep_idt strip_java_namespace_prefix (const irep_idt to_strip)
338
328
{
339
329
const auto to_strip_str=id2string (to_strip);
@@ -1600,7 +1590,12 @@ codet java_bytecode_convert_methodt::convert_instructions(
1600
1590
1601
1591
binary_relation_exprt condition (op[0 ], cmp_op, op[1 ]);
1602
1592
1603
- cast_if_necessary (condition);
1593
+ exprt &lhs (condition.lhs ());
1594
+ exprt &rhs (condition.rhs ());
1595
+ const typet &lhs_type (lhs.type ());
1596
+ if (lhs_type!=rhs.type ())
1597
+ rhs=typecast_exprt (rhs, lhs_type);
1598
+
1604
1599
code_branch.cond ()=condition;
1605
1600
code_branch.cond ().add_source_location ()=i_it->source_location ;
1606
1601
code_branch.then_case ()=code_gotot (label (number));
0 commit comments