From e6d29e5db48c9359fa74cc811300e6698d02448a Mon Sep 17 00:00:00 2001 From: oliver Date: Mon, 22 Jan 2024 15:32:30 +0100 Subject: [PATCH] convert tabs to spaces --- .../74-invalid_deref/30-mem-oob-struct.c | 21 ++++------ .../97-relational-malloc/02-simple-if-else.c | 42 +++++++++---------- .../97-relational-malloc/03-global.c | 24 +++++------ .../03-simple-if-else.c | 22 +++++----- .../98-relational-array-oob/04-global.c | 24 +++++------ 5 files changed, 64 insertions(+), 69 deletions(-) diff --git a/tests/regression/74-invalid_deref/30-mem-oob-struct.c b/tests/regression/74-invalid_deref/30-mem-oob-struct.c index bf0a7304be8..04208e953b1 100644 --- a/tests/regression/74-invalid_deref/30-mem-oob-struct.c +++ b/tests/regression/74-invalid_deref/30-mem-oob-struct.c @@ -2,28 +2,23 @@ #include 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); } diff --git a/tests/regression/97-relational-malloc/02-simple-if-else.c b/tests/regression/97-relational-malloc/02-simple-if-else.c index 52534ad8ace..0e71c8f89c7 100644 --- a/tests/regression/97-relational-malloc/02-simple-if-else.c +++ b/tests/regression/97-relational-malloc/02-simple-if-else.c @@ -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); + } } \ No newline at end of file diff --git a/tests/regression/97-relational-malloc/03-global.c b/tests/regression/97-relational-malloc/03-global.c index 1be3dc31219..c7179948393 100644 --- a/tests/regression/97-relational-malloc/03-global.c +++ b/tests/regression/97-relational-malloc/03-global.c @@ -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); } \ No newline at end of file diff --git a/tests/regression/98-relational-array-oob/03-simple-if-else.c b/tests/regression/98-relational-array-oob/03-simple-if-else.c index 87fdf233737..d1b9e48aa82 100644 --- a/tests/regression/98-relational-array-oob/03-simple-if-else.c +++ b/tests/regression/98-relational-array-oob/03-simple-if-else.c @@ -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 + } } diff --git a/tests/regression/98-relational-array-oob/04-global.c b/tests/regression/98-relational-array-oob/04-global.c index f104cce63a3..ed476acd343 100644 --- a/tests/regression/98-relational-array-oob/04-global.c +++ b/tests/regression/98-relational-array-oob/04-global.c @@ -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); }