-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more fixes relating to provenance, pointers, and unspecified values (#…
…178) * more fixes relating to provenance, pointers, and unspecified values * more fixes for cerberus tests * temp * more cerberus tweaks * add tests to test suite * fix whitespace * fix examples * fix syntax error * fix another bug * fix tests * fix one more test * some minor bug fixes * fix another issue with equality types * another bug fix in a test * add some exceptions for commonly used integer constants cast to pointers * fix another broken test * fix test failure
- Loading branch information
dwightguth
committed
May 23, 2016
1 parent
9db8d8a
commit 18e9c81
Showing
72 changed files
with
567 additions
and
267 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
11 changes: 0 additions & 11 deletions
11
examples/error-codes/implementation-defined/IMPL-CCV8-bad.c
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
examples/error-codes/implementation-defined/IMPL-CCV8-bad.output
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
int main(void){ | ||
char a[5] = "abc"; | ||
char* p = realloc(a, 5); | ||
p[0]; | ||
p[0] = 'a'; | ||
return 0; | ||
} |
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
int main(void){ | ||
unsigned char a[5] = "abc"; | ||
unsigned char* p = realloc(0, 5); | ||
p[0]; | ||
p[0] = 'a'; | ||
return 0; | ||
} |
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
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...or-codes/unspecified/USP-CEER2-bad.output → ...ror-codes/unspecified/USP-CMR1-bad.output
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,6 +1,6 @@ | ||
Error: USP-CEER2 | ||
Error: USP-CMR1 | ||
Description: Trying to reinterpret integer bytes as floating bytes. | ||
Type: Unspecified value or behavior. | ||
See also: C11 sec. 6.2.6.1:1, J.1:1 item 9 | ||
at main(USP-CEER2-bad.c:10) | ||
at main(USP-CMR1-bad.c:10) | ||
at <file-scope>(<unknown>) |
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
...ples/error-codes/undefined/UB-CEA6-good.c → ...es/error-codes/unspecified/USP-CMR2-bad.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,12 +1,12 @@ | ||
// Copyright (c) 2015 Runtime Verification, Inc. (RV-Match team). All Rights Reserved. | ||
|
||
int x; | ||
union { | ||
short x; | ||
int y; | ||
int x; | ||
float y; | ||
} foo; | ||
int main(void){ | ||
foo.y = 1; | ||
int y = 5 + foo.y; | ||
|
||
int main() { | ||
foo.y = 1.0; | ||
int x = foo.x; | ||
return 0; | ||
} |
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,6 @@ | ||
Error: USP-CMR2 | ||
Description: Trying to reinterpret floating bytes as integer bytes. | ||
Type: Unspecified value or behavior. | ||
See also: C11 sec. 6.2.6.1:1, J.1:1 item 9 | ||
at main(USP-CMR2-bad.c:10) | ||
at <file-scope>(<unknown>) |
12 changes: 6 additions & 6 deletions
12
examples/error-codes/undefined/UB-CEA6-bad.c → ...s/error-codes/unspecified/USP-CMR2-good.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,12 +1,12 @@ | ||
// Copyright (c) 2015 Runtime Verification, Inc. (RV-Match team). All Rights Reserved. | ||
|
||
int x; | ||
union { | ||
short x; | ||
int y; | ||
int x; | ||
float y; | ||
} foo; | ||
int main(void){ | ||
foo.x = 1; | ||
int y = 5 + foo.y; | ||
|
||
int main() { | ||
foo.y = 1.0; | ||
char x = *((char *)&foo.x); | ||
return 0; | ||
} |
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,13 @@ | ||
union U { | ||
char a; | ||
int b; | ||
} u; | ||
|
||
int main(void){ | ||
u.b = 0; | ||
u.a = 0; | ||
switch(u.b) { | ||
case 1: | ||
break; | ||
} | ||
} |
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,6 @@ | ||
Error: USP-ESS1 | ||
Description: Switching on an unspecified controlling expression. | ||
Type: Unspecified value or behavior. | ||
See also: C11 sec. 6.8.4.2:5 | ||
at main(USP-ESS1-bad.c:9) | ||
at <file-scope>(<unknown>) |
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,14 @@ | ||
union U { | ||
char a; | ||
int b; | ||
} u; | ||
|
||
int main(void){ | ||
u.b = 0; | ||
u.a = 0; | ||
// u.b is now unspecified | ||
switch(u.a) { | ||
case 1: | ||
break; | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
examples/error-codes/violates-constraint/fatal/CV-CERL8-bad-static.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
int main() { | ||
float a; | ||
float *b = &a; | ||
int x; | ||
int *y = &x; | ||
y == b; | ||
return 0; | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/error-codes/violates-constraint/fatal/CV-CERL8-bad-static.output
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,7 @@ | ||
File: CV-CERL8-bad-static.c | ||
Line: 6 | ||
Error: CV-CERL8 | ||
Description: Invalid operand types to ==. | ||
Type: Constraint violation. | ||
See also: C11 sec. 6.5.9:2 | ||
Translation failed (config dumped). Run kcc -d CV-CERL8-bad-static.c to see commands run. |
8 changes: 8 additions & 0 deletions
8
examples/error-codes/violates-constraint/fatal/CV-CERL8-good.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
int main() { | ||
float a; | ||
float *b = &a; | ||
int x; | ||
int *y = &x; | ||
y == (int *)b; | ||
return 0; | ||
} |
8 changes: 8 additions & 0 deletions
8
examples/error-codes/violates-constraint/fatal/CV-CERL9-bad-static.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
int main() { | ||
float a; | ||
float *b = &a; | ||
int x; | ||
int *y = &x; | ||
y != b; | ||
return 0; | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/error-codes/violates-constraint/fatal/CV-CERL9-bad-static.output
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,7 @@ | ||
File: CV-CERL9-bad-static.c | ||
Line: 6 | ||
Error: CV-CERL9 | ||
Description: Invalid operand types to !=. | ||
Type: Constraint violation. | ||
See also: C11 sec. 6.5.9:2 | ||
Translation failed (config dumped). Run kcc -d CV-CERL9-bad-static.c to see commands run. |
8 changes: 8 additions & 0 deletions
8
examples/error-codes/violates-constraint/fatal/CV-CERL9-good.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
int main() { | ||
float a; | ||
float *b = &a; | ||
int x; | ||
int *y = &x; | ||
y != (int *)b; | ||
return 0; | ||
} |
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 |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
|
||
int main() { | ||
int x = 0; | ||
int *y = 1 ? &x : 1; | ||
int *y = 1 ? &x : 2; | ||
return 0; | ||
} |
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
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
Oops, something went wrong.