@@ -9,11 +9,6 @@ Author: Daniel Kroening, kroening@kroening.com
99// / \file
1010// / Symbolic Execution
1111
12- #include " goto_symex.h"
13- #include " goto_symex_is_constant.h"
14-
15- #include < algorithm>
16-
1712#include < util/exception_utils.h>
1813#include < util/expr_util.h>
1914#include < util/invariant.h>
@@ -22,11 +17,16 @@ Author: Daniel Kroening, kroening@kroening.com
2217#include < util/simplify_expr.h>
2318#include < util/std_expr.h>
2419
20+ #include < langapi/language_util.h>
2521#include < pointer-analysis/add_failed_symbols.h>
2622#include < pointer-analysis/value_set_dereference.h>
2723
24+ #include " goto_symex.h"
25+ #include " goto_symex_is_constant.h"
2826#include " path_storage.h"
2927
28+ #include < algorithm>
29+
3030void goto_symext::apply_goto_condition (
3131 goto_symex_statet ¤t_state,
3232 goto_statet &jump_taken_state,
@@ -279,10 +279,19 @@ void goto_symext::symex_goto(statet &state)
279279 {
280280 // generate assume(false) or a suitable negation if this
281281 // instruction is a conditional goto
282- if (new_guard.is_true ())
283- symex_assume_l2 (state, false_exprt ());
284- else
285- symex_assume_l2 (state, not_exprt (new_guard));
282+ exprt negated_guard = not_exprt{new_guard};
283+ do_simplify (negated_guard);
284+ log.statistics () << " replacing self-loop at "
285+ << state.source .pc ->source_location () << " by assume("
286+ << from_expr (ns, state.source .function_id , negated_guard)
287+ << " )" << messaget::eom;
288+ if (symex_config.unwinding_assertions )
289+ {
290+ log.warning ()
291+ << " no unwinding assertion will be generated for self-loop at "
292+ << state.source .pc ->source_location () << messaget::eom;
293+ }
294+ symex_assume_l2 (state, negated_guard);
286295
287296 // next instruction
288297 symex_transition (state);
0 commit comments