Commit 7e64ca4c authored by Dario Pinto's avatar Dario Pinto

fix some syntactic changes

parent ff76bbc2
......@@ -37,6 +37,7 @@ FCFLAGS += \
# (Optional) Eva-specific flags
EVAFLAGS += \
-eva-warn-key builtins:missing-spec=abort \
-eva-precision 3 \
# excludes files with recursive functions
filter-out-substring = $(foreach v,$(2),$(if $(findstring $(1),$(v)),,$(v)))
......
......@@ -7,7 +7,7 @@ int main() {
file = fopen("file.txt","r");
if(!file) {
return 1;
return 0;
}
printf("%i\n", (int) fgetc(file));
......
......@@ -7,7 +7,7 @@ int main() {
file = fopen("file.txt","r");
if(!file) {
return 1;
return 0;
}
printf("%i\n", (int) fgetc(file));
......
......@@ -17,9 +17,9 @@ void nullpointer_cross_file(bool a, bool b) {
ptr = (int*)choose_pointer((void*)(arr+1), 0, a);
if(b) {
val = arr[2];
val = arr[1];
} else {
val = ptr[2]; /* DANGER, if !a & !b */
val = ptr[1]; /* DANGER, if !a & !b */
}
printf("%i\n", val);
......
......@@ -21,7 +21,7 @@ GOTO_LABEL:
printf("%i\n", val);
}
val = val * 2;
val = val * 2u;
if(i == 0) {
i++;
......
......@@ -13,7 +13,12 @@ void integer_overflow_cross_file(bool a, bool b) {
}
#endif
val = choose_int(2, INT_MAX / 3 - 1, INT_MAX / 2 - 1);
if (!a && !b) {
val = choose_int(2, INT_MAX / 2 - 1, 0);
}
else
val = choose_int(2, INT_MAX / 3 - 1, INT_MAX / 2 - 1);
if(b) {
val = val * 2;
......
......@@ -3,7 +3,7 @@
#include "integer_overflow.h"
void integer_overflow_for_complex(int x) {
int val = INT_MAX - 20;
int val = INT_MAX / 2 - 20;
int i = 0;
#ifdef CATCH_BAD_PARAM
......
......@@ -3,7 +3,7 @@
#include "integer_overflow.h"
void integer_overflow_while_continue(int x) {
int val = INT_MAX - 20;
int val = INT_MAX / 2 - 20;
int i = 0;
#ifdef CATCH_BAD_PARAM
......
......@@ -3,7 +3,7 @@
#include "integer_overflow.h"
void integer_overflow_do_while_continue(int x) {
int val = INT_MAX - 20;
int val = INT_MAX / 2 - 20;
int i = 0;
#ifdef CATCH_BAD_PARAM
......
......@@ -27,22 +27,22 @@ void double_free_while_continue(int x) {
i++;
continue;
}
if(i == 10) {
if(i > x && is_freed) { /* should be !is_freed */
free(data); /* DANGER: x < 10 */
data = malloc(5*sizeof(int));
if(!data) {
return;
}
is_freed = false;
} else {
n_freed--;
}
if(i > x && is_freed) { /* should be !is_freed */
free(data); /* DANGER: x < 10 */
if(i == 10) {
data = malloc(5*sizeof(int));
if(!data) {
return;
}
is_freed = false;
} else {
n_freed--;
}
i++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment