Skip to content

Commit 3dacfda

Browse files
committed
const & protect goto_symext::constant_propagation
This member is never written to and serves merely as a cache for a front-end option, so this commit makes it const and protected.
1 parent 7d17590 commit 3dacfda

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/cbmc/bmc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class bmct:public safety_checkert
8686
ui_message_handler(_message_handler),
8787
driver_callback_after_symex(callback_after_symex)
8888
{
89-
symex.constant_propagation=options.get_bool_option("propagation");
9089
symex.record_coverage=
9190
!options.get_option("symex-coverage-report").empty();
9291
symex.self_loops_to_assumptions =
@@ -162,7 +161,6 @@ class bmct:public safety_checkert
162161
ui_message_handler(_message_handler),
163162
driver_callback_after_symex(callback_after_symex)
164163
{
165-
symex.constant_propagation = options.get_bool_option("propagation");
166164
symex.record_coverage =
167165
!options.get_option("symex-coverage-report").empty();
168166
INVARIANT(

src/goto-instrument/accelerate/scratch_program.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ bool scratch_programt::check_sat(bool do_slice)
3535
output(ns, "scratch", std::cout);
3636
#endif
3737

38-
symex.constant_propagation=constant_propagation;
3938
goto_symex_statet::propagationt::valuest constants;
4039

4140
symex.symex_with_state(symex_state, functions, symex_symbol_table);

src/goto-symex/goto_symex.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class goto_symext
6262
options.get_bool_option("allow-pointer-unsoundness")),
6363
total_vccs(0),
6464
remaining_vccs(0),
65-
constant_propagation(true),
6665
self_loops_to_assumptions(true),
6766
language_mode(),
67+
constant_propagation(options.get_bool_option("propagation")),
6868
outer_symbol_table(outer_symbol_table),
6969
ns(outer_symbol_table),
7070
target(_target),
@@ -212,14 +212,15 @@ class goto_symext
212212
// statistics
213213
unsigned total_vccs, remaining_vccs;
214214

215-
bool constant_propagation;
216215
bool self_loops_to_assumptions;
217216

218217
/// language_mode: ID_java, ID_C or another language identifier
219218
/// if we know the source language in use, irep_idt() otherwise.
220219
irep_idt language_mode;
221220

222221
protected:
222+
const bool constant_propagation;
223+
223224
/// The symbol table associated with the goto-program that we're
224225
/// executing. This symbol table will not additionally contain objects
225226
/// that are dynamically created as part of symbolic execution; the

0 commit comments

Comments
 (0)