Skip to content

Commit 9fe58f6

Browse files
authored
Merge pull request #3838 from tautschnig/function-convert_java_nondet
convert_java_nondet passes down function identifier [blocks: #3126]
2 parents 2dab426 + 55f978d commit 9fe58f6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

jbmc/src/java_bytecode/convert_java_nondet.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static goto_programt get_gen_nondet_init_instructions(
6868
/// Checks an instruction to see whether it contains an assignment from
6969
/// side_effect_expr_nondet. If so, replaces the instruction with a range of
7070
/// instructions to properly nondet-initialize the lhs.
71+
/// \param function_identifier: Name of the function containing \p target.
7172
/// \param goto_program: The goto program to modify.
7273
/// \param target: One of the steps in that goto program.
7374
/// \param symbol_table: The global symbol table.
@@ -78,6 +79,7 @@ static goto_programt get_gen_nondet_init_instructions(
7879
/// \return The next instruction to process with this function and a boolean
7980
/// indicating whether any changes were made to the goto program.
8081
static std::pair<goto_programt::targett, bool> insert_nondet_init_code(
82+
const irep_idt &function_identifier,
8183
goto_programt &goto_program,
8284
const goto_programt::targett &target,
8385
symbol_table_baset &symbol_table,
@@ -116,7 +118,7 @@ static std::pair<goto_programt::targett, bool> insert_nondet_init_code(
116118

117119
symbolt &aux_symbol = get_fresh_aux_symbol(
118120
op.type(),
119-
id2string(goto_programt::get_function_id(goto_program)),
121+
id2string(function_identifier),
120122
"nondet_tmp",
121123
source_loc,
122124
ID_java,
@@ -162,13 +164,15 @@ static std::pair<goto_programt::targett, bool> insert_nondet_init_code(
162164
/// For each instruction in the goto program, checks if it is an assignment from
163165
/// nondet and replaces it with the appropriate composite initialization code if
164166
/// so.
167+
/// \param function_identifier: Name of the function \p goto_program.
165168
/// \param goto_program: The goto program to modify.
166169
/// \param symbol_table: The global symbol table.
167170
/// \param message_handler: Handles logging.
168171
/// \param object_factory_parameters: Parameters for the generation of nondet
169172
/// objects.
170173
/// \param mode: Language mode
171174
void convert_nondet(
175+
const irep_idt &function_identifier,
172176
goto_programt &goto_program,
173177
symbol_table_baset &symbol_table,
174178
message_handlert &message_handler,
@@ -181,6 +185,7 @@ void convert_nondet(
181185
while(instruction_iterator != goto_program.instructions.end())
182186
{
183187
auto ret = insert_nondet_init_code(
188+
function_identifier,
184189
goto_program,
185190
instruction_iterator,
186191
symbol_table,
@@ -206,6 +211,7 @@ void convert_nondet(
206211
java_object_factory_parameterst parameters = object_factory_parameters;
207212
parameters.function_id = function.get_function_id();
208213
convert_nondet(
214+
function.get_function_id(),
209215
function.get_goto_function().body,
210216
function.get_symbol_table(),
211217
message_handler,
@@ -232,6 +238,7 @@ void convert_nondet(
232238
java_object_factory_parameterst parameters = object_factory_parameters;
233239
parameters.function_id = f_it.first;
234240
convert_nondet(
241+
f_it.first,
235242
f_it.second.body,
236243
symbol_table,
237244
message_handler,

0 commit comments

Comments
 (0)