Skip to content

Commit

Permalink
convert tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
FungOliver committed Jan 24, 2024
1 parent 21419ac commit e6d29e5
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 69 deletions.
21 changes: 8 additions & 13 deletions tests/regression/74-invalid_deref/30-mem-oob-struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@
#include <stdlib.h>

struct A {
unsigned char a;
unsigned char b;
unsigned char c;
unsigned char d;
unsigned char e;
unsigned char f;
unsigned char g;
unsigned char h;
unsigned int a;
unsigned int b;
};

int main(void)
{
struct A *p;
struct A *f;
p = malloc(9);
struct A *p;
struct A *f;
p = malloc(9);

p->a = 1; // NOWARN

f = p + 1;

f->b = 2; // WARN

free(p);
(f-1)->a = 3;
(f-1+(2))->b = 4;
free(p);
}

42 changes: 21 additions & 21 deletions tests/regression/97-relational-malloc/02-simple-if-else.c
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);
}
}
24 changes: 12 additions & 12 deletions tests/regression/97-relational-malloc/03-global.c
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);
}
22 changes: 11 additions & 11 deletions tests/regression/98-relational-array-oob/03-simple-if-else.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

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[len];
char ptr[len];

for(int i=0;i < len;i++) {
char s = ptr[i]; //NOWARN
}
for(int i=0;i < len;i++) {
char s = ptr[i]; //NOWARN
}
}

24 changes: 12 additions & 12 deletions tests/regression/98-relational-array-oob/04-global.c
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);
}

0 comments on commit e6d29e5

Please sign in to comment.