Skip to content

Commit 99ea8fe

Browse files
committed
JBMC: run replace-Java-nondet on function-by-function basis
1 parent bfd4f50 commit 99ea8fe

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/goto-programs/replace_java_nondet.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ static void replace_java_nondet(goto_programt &goto_program)
235235
}
236236
}
237237

238+
void replace_java_nondet(goto_model_functiont &function)
239+
{
240+
goto_programt &program = function.get_goto_function().body;
241+
replace_java_nondet(program);
242+
243+
function.compute_location_numbers();
244+
245+
remove_skip(program);
246+
}
247+
238248
void replace_java_nondet(goto_functionst &goto_functions)
239249
{
240250
for(auto &goto_program : goto_functions.function_map)

src/goto-programs/replace_java_nondet.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Reuben Thomas, [email protected]
1414

1515
class goto_modelt;
1616
class goto_functionst;
17+
class goto_model_functiont;
1718

1819
/// Replace calls to nondet library functions with an internal nondet
1920
/// representation.
@@ -22,4 +23,9 @@ void replace_java_nondet(goto_modelt &);
2223

2324
void replace_java_nondet(goto_functionst &);
2425

26+
/// Replace calls to nondet library functions with an internal nondet
27+
/// representation in a single function.
28+
/// \param function: The goto program to modify.
29+
void replace_java_nondet(goto_model_functiont &function);
30+
2531
#endif

src/jbmc/jbmc_parse_options.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ void jbmc_parse_optionst::process_goto_function(
664664
};
665665

666666
remove_returns(function, function_is_stub);
667+
668+
replace_java_nondet(function);
667669
}
668670

669671
catch(const char *e)
@@ -718,8 +720,6 @@ bool jbmc_parse_optionst::process_goto_functions(
718720
? std::stoul(cmdline.get_value("java-max-input-tree-depth"))
719721
: MAX_NONDET_TREE_DEPTH;
720722

721-
replace_java_nondet(goto_model);
722-
723723
convert_nondet(
724724
goto_model,
725725
get_message_handler(),

0 commit comments

Comments
 (0)