-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CN: add a test for the self-ref init case
Cerberus treats this as UB, whereas some Linux code seems to assume it works. Add an "unknown" category to the CN tests for code where it's not clear if it should be rejected or not.
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
/* based on a problematic example from linux kvm/pgtable.c */ | ||
|
||
struct str { | ||
int x; | ||
int y; | ||
}; | ||
|
||
int f (int x) | ||
/*@ requires (0 <= x) && (x < 200) @*/ | ||
{ | ||
struct str str_inst = { | ||
.x = x + 2, | ||
.y = str_inst.x + 3, | ||
}; | ||
|
||
return str_inst.y; | ||
} | ||
|
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