-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7846 from esteffin/esteffin/shadow-memory-set-fie…
…ld-op Add shadow memory set_field operation
- Loading branch information
Showing
34 changed files
with
487 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
--unwind 11 | ||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
--unwind 11 | ||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
2 changes: 1 addition & 1 deletion
2
regression/cbmc-shadow-memory/nondet-pointer-into-struct1/test.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--unwind 4 | ||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include <assert.h> | ||
|
||
struct S | ||
{ | ||
short x[3]; | ||
char c; | ||
}; | ||
|
||
int main(void) | ||
{ | ||
__CPROVER_field_decl_local("f", (char)0); | ||
|
||
struct S s; | ||
|
||
// Setting the struct recursively set all its fields | ||
__CPROVER_set_field(&s, "f", 1); | ||
|
||
assert(__CPROVER_get_field(&s.x[0], "f") == 1); | ||
assert(__CPROVER_get_field(&s.x[1], "f") == 1); | ||
assert(__CPROVER_get_field(&s.x[2], "f") == 1); | ||
assert(__CPROVER_get_field(&s.c, "f") == 1); | ||
assert(__CPROVER_get_field(&s, "f") == 1); | ||
|
||
// Setting the struct recursively set all its fields | ||
__CPROVER_set_field(&s, "f", 0); | ||
|
||
assert(__CPROVER_get_field(&s.x[0], "f") == 0); | ||
assert(__CPROVER_get_field(&s.x[1], "f") == 0); | ||
assert(__CPROVER_get_field(&s.x[2], "f") == 0); | ||
assert(__CPROVER_get_field(&s.c, "f") == 0); | ||
assert(__CPROVER_get_field(&s, "f") == 0); | ||
|
||
// Setting a field of the struct changes its values ad after aggregation the whole struct value | ||
__CPROVER_set_field(&s.x[1], "f", 2); | ||
|
||
assert(__CPROVER_get_field(&s.x[0], "f") == 0); | ||
assert(__CPROVER_get_field(&s.x[1], "f") == 2); | ||
assert(__CPROVER_get_field(&s.x[2], "f") == 0); | ||
assert(__CPROVER_get_field(&s.c, "f") == 0); | ||
assert(__CPROVER_get_field(&s, "f") == 2); | ||
|
||
// Rest shadow memory | ||
__CPROVER_set_field(&s, "f", 0); | ||
|
||
// Changing ONLY first cell of S array at field x by using offset with pointer arithmetics | ||
short *p = ((short *)&s) + 1; | ||
__CPROVER_set_field(p, "f", 3); | ||
|
||
assert(__CPROVER_get_field(&s.x[0], "f") == 0); | ||
assert(__CPROVER_get_field(&s.x[1], "f") == 3); | ||
assert(__CPROVER_get_field(&s.x[2], "f") == 0); | ||
assert(__CPROVER_get_field(&s.c, "f") == 0); | ||
assert(__CPROVER_get_field(&s, "f") == 3); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
^warning: ignoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
--unwind 15 | ||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
--stop-on-fail --unwind 5 | ||
^EXIT=10$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
KNOWNBUG | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=6$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
|
||
^EXIT=0$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.