Skip to content

Commit 177d0d4

Browse files
Use remove_java_new
1 parent ce11613 commit 177d0d4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/jbmc/jbmc_parse_options.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ Author: Daniel Kroening, [email protected]
5353

5454
#include <java_bytecode/java_bytecode_language.h>
5555
#include <java_bytecode/java_enum_static_init_unwind_handler.h>
56-
#include <java_bytecode/remove_instanceof.h>
5756
#include <java_bytecode/remove_exceptions.h>
57+
#include <java_bytecode/remove_instanceof.h>
58+
#include <java_bytecode/remove_java_new.h>
5859
#include <java_bytecode/replace_java_nondet.h>
5960

6061
#include <cbmc/version.h>
@@ -763,6 +764,9 @@ void jbmc_parse_optionst::process_goto_function(
763764
// add generic checks
764765
goto_check(ns, options, ID_java, function.get_goto_function());
765766

767+
// Replace Java new side effects
768+
remove_java_new(goto_function, symbol_table, get_message_handler());
769+
766770
// checks don't know about adjusted float expressions
767771
adjust_float_expressions(goto_function, ns);
768772

unit/pointer-analysis/custom_value_set_analysis.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Chris Smowton, [email protected]
1414
#include <goto-programs/goto_inline.h>
1515
#include <java_bytecode/java_bytecode_language.h>
1616
#include <java_bytecode/java_types.h>
17+
#include <java_bytecode/remove_java_new.h>
1718
#include <pointer-analysis/value_set_analysis.h>
1819

1920
/// An example customised value_sett. It makes a series of small changes
@@ -183,6 +184,9 @@ SCENARIO("test_value_set_analysis",
183184
goto_modelt goto_model=
184185
initialize_goto_model(command_line, null_output);
185186

187+
null_message_handlert message_handler;
188+
remove_java_new(goto_model, message_handler);
189+
186190
namespacet ns(goto_model.symbol_table);
187191

188192
// Fully inline the test program, to avoid VSA conflating

0 commit comments

Comments
 (0)