-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21419ac
commit e6d29e5
Showing
5 changed files
with
64 additions
and
69 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
42 changes: 21 additions & 21 deletions
42
tests/regression/97-relational-malloc/02-simple-if-else.c
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,27 +1,27 @@ | ||
//PARAM: --set ana.activated[+] memOutOfBounds --enable ana.int.interval --set ana.activated[+] apron --set ana.apron.domain polyhedra | ||
int main() { | ||
int len; | ||
int top; | ||
int len; | ||
int top; | ||
|
||
if(top) { | ||
len = 5; | ||
} else { | ||
len = 10; | ||
} | ||
if(top) { | ||
len = 5; | ||
} else { | ||
len = 10; | ||
} | ||
|
||
char* ptr = malloc(2*len); | ||
char* ptr = malloc(2*len); | ||
char* ptr2 = malloc(sizeof(char)*len); | ||
for(int i=0;i < len;i++) { | ||
int t = rand(); | ||
if (t > len ){ | ||
t = len -1; | ||
}else { | ||
t= t-1; | ||
if (t < 0){ | ||
t = 0; | ||
} | ||
} | ||
char s = ptr[t]; //NOWARN | ||
assert(i < len); | ||
} | ||
for(int i=0;i < len;i++) { | ||
int t = rand(); | ||
if (t > len ){ | ||
t = len -1; | ||
}else { | ||
t= t-1; | ||
if (t < 0){ | ||
t = 0; | ||
} | ||
} | ||
char s = ptr[t]; //NOWARN | ||
assert(i < len); | ||
} | ||
} |
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,18 +1,18 @@ | ||
//PARAM: --set ana.activated[+] memOutOfBounds --enable ana.int.interval --set ana.activated[+] apron --set ana.apron.domain polyhedra | ||
int readUntil(char arr[], int len) { | ||
for(int i=0;i < len;i++) { | ||
char s = arr[i]; //NOWARN | ||
} | ||
for(int i=0;i < len;i++) { | ||
char s = arr[i]; //NOWARN | ||
} | ||
} | ||
|
||
int main() { | ||
int len; | ||
int top; | ||
if(top) { | ||
len = 5; | ||
} else { | ||
len = 10; | ||
} | ||
char* ptr = malloc(sizeof(char)*len); | ||
readUntil(ptr, len); | ||
int len; | ||
int top; | ||
if(top) { | ||
len = 5; | ||
} else { | ||
len = 10; | ||
} | ||
char* ptr = malloc(sizeof(char)*len); | ||
readUntil(ptr, len); | ||
} |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
//PARAM: --enable ana.arrayoob --enable ana.int.interval --set ana.activated[+] apron --set sem.int.signed_overflow assume_none | ||
|
||
int readUntil(char arr[], unsigned len) { | ||
for(unsigned int i=0;i < len;i++) { | ||
char s = arr[i]; //NOWARN | ||
} | ||
for(unsigned int i=0;i < len;i++) { | ||
char s = arr[i]; //NOWARN | ||
} | ||
} | ||
|
||
int main() { | ||
unsigned int len; | ||
unsigned int top; | ||
unsigned int len; | ||
unsigned int top; | ||
|
||
if(top) { | ||
len = 5; | ||
} else { | ||
len = 10; | ||
} | ||
if(top) { | ||
len = 5; | ||
} else { | ||
len = 10; | ||
} | ||
|
||
char ptr[len]; | ||
readUntil(ptr, len); | ||
char ptr[len]; | ||
readUntil(ptr, len); | ||
} |