Skip to content

Commit ce9f1fc

Browse files
Use remove_java_new
1 parent ce11613 commit ce9f1fc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/jbmc/jbmc_parse_options.cpp

+5-1
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

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ Author: Chris Smowton, [email protected]
88

99
#include <testing-utils/catch.hpp>
1010

11-
#include <util/config.h>
12-
#include <langapi/mode.h>
13-
#include <goto-programs/initialize_goto_model.h>
1411
#include <goto-programs/goto_inline.h>
12+
#include <goto-programs/initialize_goto_model.h>
1513
#include <java_bytecode/java_bytecode_language.h>
1614
#include <java_bytecode/java_types.h>
15+
#include <java_bytecode/remove_java_new.h>
16+
#include <langapi/mode.h>
1717
#include <pointer-analysis/value_set_analysis.h>
18+
#include <util/config.h>
1819

1920
/// An example customised value_sett. It makes a series of small changes
2021
/// to the underlying value_sett logic, which can then be verified by the
@@ -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)