-
Notifications
You must be signed in to change notification settings - Fork 275
Goto-harness support to selectively havoc struct members #5183
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
Goto-harness support to selectively havoc struct members #5183
Conversation
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: d9a1bb4).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/136301109
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: f096f4d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/136317859
@@ -16,6 +16,7 @@ Author: Diffblue Ltd. | |||
#define COMMON_HARNESS_GENERATOR_MAX_ARRAY_SIZE_OPT "max-array-size" | |||
#define COMMON_HARNESS_GENERATOR_FUNCTION_POINTER_CAN_BE_NULL_OPT \ | |||
"function-pointer-can-be-null" | |||
#define COMMON_HARNESS_GENERATOR_MEMBER_SELECTION_OPT "member-selection" |
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 don’t really like the name member-selection
, following the pattern it should be called something like nondet-member
or havoc-member
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.
Done.
@@ -85,6 +86,22 @@ bool recursive_initialization_configt::handle_option( | |||
[](const std::string &opt) -> irep_idt { return irep_idt{opt}; }); | |||
return true; | |||
} | |||
else if(option == COMMON_HARNESS_GENERATOR_MEMBER_SELECTION_OPT) |
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.
Correct me if I’m wrong, but this looks as if you can only have one member havoc'd at a time? Because that shouldn’t be the case.
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.
Done.
to goto-harness. By means of a new option `member-selection` the user can now specify a struct-within-struct path, e.g. `struct_outer.struct_inner.data` to specify only which member they want to havoc. Includes a test.
via a comma-separated list. Plus one more test.
f096f4d
to
65bfa60
Compare
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.
LGTM
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 we’d probably also want things like “these two fields in this struct can point to the same variable” or “this field in that struct is the length of the array in that struct”, but not in this PR |
By means of a new option
havoc-member
the user can now specify a struct-within-struct path, e.g.struct_outer.struct_inner.data
to specify only which member they want to havoc.Includes a test.