@@ -1808,30 +1808,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
1808
1808
symbol_table.has_symbol (symbol_expr.get_identifier ()),
1809
1809
" putstatic symbol should have been created before method conversion" );
1810
1810
1811
- if (needed_lazy_methods && arg0.type ().id () == ID_symbol)
1812
- {
1813
- needed_lazy_methods->add_needed_class (
1814
- to_symbol_type (arg0.type ()).get_identifier ());
1815
- }
1816
-
1817
- code_blockt block;
1818
- block.add_source_location ()=i_it->source_location ;
1819
-
1820
- // Note this initializer call deliberately inits the class used to make
1821
- // the reference, which may be a child of the class that actually defines
1822
- // the field.
1823
- codet clinit_call=get_clinit_call (arg0.get_string (ID_class));
1824
- if (clinit_call.get_statement ()!=ID_skip)
1825
- block.move_to_operands (clinit_call);
1826
-
1827
- save_stack_entries (
1828
- " stack_static_field" ,
1829
- symbol_expr.type (),
1830
- block,
1831
- bytecode_write_typet::STATIC_FIELD,
1832
- symbol_expr.get_identifier ());
1833
- block.copy_to_operands (code_assignt (symbol_expr, op[0 ]));
1834
- c=block;
1811
+ c = convert_putstatic (i_it->source_location , arg0, op, symbol_expr);
1835
1812
}
1836
1813
else if (statement==patternt (" ?2?" )) // i2c etc.
1837
1814
{
@@ -2425,6 +2402,38 @@ codet java_bytecode_convert_methodt::convert_instructions(
2425
2402
return code;
2426
2403
}
2427
2404
2405
+ codet java_bytecode_convert_methodt::convert_putstatic (
2406
+ const source_locationt &location,
2407
+ const exprt &arg0,
2408
+ const exprt::operandst &op,
2409
+ const symbol_exprt &symbol_expr)
2410
+ {
2411
+ if (needed_lazy_methods && arg0.type ().id () == ID_symbol)
2412
+ {
2413
+ needed_lazy_methods->add_needed_class (
2414
+ to_symbol_type (arg0.type ()).get_identifier ());
2415
+ }
2416
+
2417
+ code_blockt block;
2418
+ block.add_source_location () = location;
2419
+
2420
+ // Note this initializer call deliberately inits the class used to make
2421
+ // the reference, which may be a child of the class that actually defines
2422
+ // the field.
2423
+ codet clinit_call = get_clinit_call (arg0.get_string (ID_class));
2424
+ if (clinit_call.get_statement () != ID_skip)
2425
+ block.move_to_operands (clinit_call);
2426
+
2427
+ save_stack_entries (
2428
+ " stack_static_field" ,
2429
+ symbol_expr.type (),
2430
+ block,
2431
+ bytecode_write_typet::STATIC_FIELD,
2432
+ symbol_expr.get_identifier ());
2433
+ block.copy_to_operands (code_assignt (symbol_expr, op[0 ]));
2434
+ return block;
2435
+ }
2436
+
2428
2437
codet java_bytecode_convert_methodt::convert_putfield (
2429
2438
const exprt &arg0,
2430
2439
const exprt::operandst &op)
0 commit comments