Skip to content

Commit 939da28

Browse files
committed
goto_symext::apply_goto_condition must honour --no-propagation
goto_symext::apply_goto_condition unconditionally wrote to the propagation map (via goto_statet::apply_condition). Although --no-propagation might not be really useful in practice, but is used for testing (including some of our existing regression tests) or debugging.
1 parent 21d3ee8 commit 939da28

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

regression/cbmc/no-propagation/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int main()
2+
{
3+
int x;
4+
if(x == 1)
5+
__CPROVER_assert(x == 1, "");
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--no-propagation
4+
Generated 1 VCC\(s\), 1 remaining after simplification
5+
^VERIFICATION SUCCESSFUL$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring

src/goto-symex/symex_goto.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ void goto_symext::apply_goto_condition(
5353
&jump_not_taken_state.value_set,
5454
ns);
5555

56+
if(!symex_config.constant_propagation)
57+
return;
58+
5659
jump_taken_state.apply_condition(new_guard, current_state, ns);
5760

5861
// Could use not_exprt + simplify, but let's avoid paying that cost on quite

0 commit comments

Comments
 (0)