-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: constraints are now properly displayed in data-flow graphs
- Loading branch information
1 parent
dff724a
commit 9fa61d0
Showing
2 changed files
with
110 additions
and
10 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
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,34 @@ | ||
/* | ||
The purpose of this code is to demonstrate the capabilities | ||
of the monster model generator of selfie. Monster translates | ||
the code to an SMT-LIB or BTOR2 formula that is satisfiable | ||
if and only if the code exits with a non-zero exit code, or | ||
performs division by zero or invalid/unsafe memory accesses. | ||
This code is exactly the same as simple-if-else-1-35.c but with symbolic exit codes. | ||
This is necessary since we only support symbolic exit codes so far. | ||
Input == #b00110001 (== 49 == '1') | ||
*/ | ||
|
||
uint64_t main() { | ||
uint64_t a; | ||
uint64_t* x; | ||
|
||
a = 40; | ||
x = malloc(8); | ||
|
||
read(0, x, 1); | ||
|
||
*x = *x - 47; | ||
|
||
if (*x == 2) | ||
a = a + *x; | ||
else | ||
a = a + (*x * 0); | ||
|
||
if (a == 42) | ||
return a; | ||
else | ||
return *x; | ||
} |