Skip to content

Goto-symex: record value-at-declaration in the back-end #6875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion regression/cbmc/atomic_section_seq1/test.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
CORE
CORE broken-smt-backend
main.c

^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
^warning: ignoring
--
This test involves empty structs, which the SMT2 back-end does not currently
support.
4 changes: 4 additions & 0 deletions regression/cbmc/trace-values/trace-values.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ int main()
int *q=&my_nested[1].f;
int *null=0;
int *junk;
struct S s;

global_var=1;
static_var=2;
Expand All @@ -34,6 +35,9 @@ int main()
// assign entire struct
my_nested[1]=my_nested[0];

// struct member
s.f = 42;

// get a trace
__CPROVER_assert(0, "");
}
2 changes: 2 additions & 0 deletions regression/cbmc/trace-values/trace-values.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ trace-values.c
--trace
^EXIT=10$
^SIGNAL=0$
^ s=\{ \.f=-?\d+, \.array=\{ -?\d+, -?\d+, -?\d+ \} \} \(\{ [01 ]+, \{ [01 ]+, [01 ]+, [01 ]+ \} \}\)$
^ global_var=1 .*$
^ static_var=2 .*$
^ local_var=3 .*$
Expand All @@ -12,6 +13,7 @@ trace-values.c
^ dynamic_object1\[1.*\]=8 .*$
^ my_nested\[1.*\](=\{ )?.f=0[ ,]
^ my_nested\[1.*\](=\{ .f=0, )?.array=\{ 0, 4, 0 \}
^ s\.f=42 \([0 ]+ 00101010\)$
^VERIFICATION FAILED$
--
^warning: ignoring
Expand Down
2 changes: 2 additions & 0 deletions src/goto-symex/symex_target_equation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ void symex_target_equationt::convert_decls(
// The result is not used, these have no impact on
// the satisfiability of the formula.
decision_procedure.handle(step.cond_expr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the handle for the cond_expr needed at all then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, one of them is ssa_lhs, the other is ssa_full_lhs.

decision_procedure.handle(
equal_exprt{step.ssa_full_lhs, step.ssa_full_lhs});
step.converted = true;
with_solver_hardness(
decision_procedure, hardness_register_ssa(step_index, step));
Expand Down