-
Notifications
You must be signed in to change notification settings - Fork 274
Add KNOWBUG test for 5093 #5094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add KNOWBUG test for 5093 #5094
Conversation
} | ||
|
||
int main() { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be left off as we pass --function
to cbmc
typedef struct ST ST; | ||
typedef struct ST { | ||
int id; | ||
ST *c[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would simply int c[]
also trigger the error?
|
||
void testFunc(ST ** t) { | ||
*t = malloc(sizeof(ST)); | ||
assert(sizeof(ST)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assert
is probably unnecessary
c8db083
to
7dca873
Compare
@@ -0,0 +1,15 @@ | |||
#include <assert.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now unnecessary 🍑
#include <assert.h> | ||
#include <stdlib.h> | ||
|
||
typedef struct ST ST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍑
// int id; | ||
// ST *c[]; | ||
int c[]; | ||
} ST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to compile this with gcc and it turns out structs with only a flexible array member are illegal. So this would need to contain int id; int c[];
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course! Thanks for checking ... I keep forgetting 😅
|
||
void testFunc(ST **t) | ||
{ | ||
*t=malloc(sizeof(ST)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried the example and this line is also unnecessary to trigger the bug.
9d513da
to
a971446
Compare
@@ -0,0 +1,11 @@ | |||
#include <stdlib.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: a971446).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/126216769
a971446
to
e202df8
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5094 +/- ##
===========================================
+ Coverage 69.66% 69.66% +<.01%
===========================================
Files 1319 1319
Lines 109250 109234 -16
===========================================
- Hits 76106 76102 -4
+ Misses 33144 33132 -12
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: e202df8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/126227218
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, tbh the entire section that causes this particular issue should probably just be removed
This PR is to add KNOWBUG for #5093