25
25
#include < ansi-c/c_types.h>
26
26
#include < ansi-c/string_constant.h>
27
27
28
- #include < goto-programs/goto_functions.h>
29
28
#include < goto-programs/remove_exceptions.h>
30
29
31
30
#include " java_entry_point.h"
@@ -98,10 +97,9 @@ Function: java_static_lifetime_init
98
97
99
98
\*******************************************************************/
100
99
101
- bool java_static_lifetime_init (
100
+ void java_static_lifetime_init (
102
101
symbol_tablet &symbol_table,
103
102
const source_locationt &source_location,
104
- message_handlert &message_handler,
105
103
bool assume_init_pointers_not_null,
106
104
unsigned max_nondet_array_length)
107
105
{
@@ -138,6 +136,7 @@ bool java_static_lifetime_init(
138
136
}
139
137
auto newsym=object_factory (
140
138
sym.type ,
139
+ symname,
141
140
code_block,
142
141
allow_null,
143
142
symbol_table,
@@ -173,8 +172,6 @@ bool java_static_lifetime_init(
173
172
code_block.add (function_call);
174
173
}
175
174
}
176
-
177
- return false ;
178
175
}
179
176
180
177
/* ******************************************************************\
@@ -194,8 +191,7 @@ exprt::operandst java_build_arguments(
194
191
code_blockt &init_code,
195
192
symbol_tablet &symbol_table,
196
193
bool assume_init_pointers_not_null,
197
- unsigned max_nondet_array_length,
198
- message_handlert &message_handler)
194
+ unsigned max_nondet_array_length)
199
195
{
200
196
const code_typet::parameterst ¶meters=
201
197
to_code_type (function.type ).parameters ();
@@ -224,27 +220,29 @@ exprt::operandst java_build_arguments(
224
220
is_main=(named_main && has_correct_type);
225
221
}
226
222
223
+ const code_typet::parametert &p=parameters[param_number];
224
+ const irep_idt base_name=p.get_base_name ().empty ()?
225
+ (" argument#" +std::to_string (param_number)):p.get_base_name ();
226
+
227
227
bool allow_null=(!is_main) && (!is_this) && !assume_init_pointers_not_null;
228
228
229
229
main_arguments[param_number]=
230
230
object_factory (
231
- parameters[param_number].type (),
231
+ p.type (),
232
+ base_name,
232
233
init_code,
233
234
allow_null,
234
235
symbol_table,
235
236
max_nondet_array_length,
236
237
function.location );
237
238
238
- const symbolt &p_symbol=
239
- symbol_table.lookup (parameters[param_number].get_identifier ());
240
-
241
239
// record as an input
242
240
codet input (ID_input);
243
241
input.operands ().resize (2 );
244
242
input.op0 ()=
245
243
address_of_exprt (
246
244
index_exprt (
247
- string_constantt (p_symbol. base_name ),
245
+ string_constantt (base_name),
248
246
from_integer (0 , index_type ())));
249
247
input.op1 ()=main_arguments[param_number];
250
248
input.add_source_location ()=function.location ;
@@ -556,13 +554,11 @@ bool java_entry_point(
556
554
557
555
create_initialize (symbol_table);
558
556
559
- if (java_static_lifetime_init (
560
- symbol_table,
561
- symbol.location ,
562
- message_handler,
563
- assume_init_pointers_not_null,
564
- max_nondet_array_length))
565
- return true ;
557
+ java_static_lifetime_init (
558
+ symbol_table,
559
+ symbol.location ,
560
+ assume_init_pointers_not_null,
561
+ max_nondet_array_length);
566
562
567
563
code_blockt init_code;
568
564
@@ -626,8 +622,7 @@ bool java_entry_point(
626
622
init_code,
627
623
symbol_table,
628
624
assume_init_pointers_not_null,
629
- max_nondet_array_length,
630
- message_handler);
625
+ max_nondet_array_length);
631
626
call_main.arguments ()=main_arguments;
632
627
633
628
init_code.move_to_operands (call_main);
0 commit comments