-
Notifications
You must be signed in to change notification settings - Fork 274
Function pointer restrictions: support labels in JSON input #6610
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
Function pointer restrictions: support labels in JSON input #6610
Conversation
9413956
to
27a04a5
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6610 +/- ##
===========================================
+ Coverage 76.62% 76.64% +0.01%
===========================================
Files 1578 1578
Lines 181180 181210 +30
===========================================
+ Hits 138833 138884 +51
+ Misses 42347 42326 -21
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.
Looks OK to me, with bonus points if there was a test case demonstrating the fix (my apologies if I missed one...), and double bonus points if there was a little extra comments - but nothing blocking.
|
||
restrict_function_pointers( | ||
ui_message_handler, goto_model, function_pointer_restrictions); | ||
restrict_function_pointers(ui_message_handler, goto_model, options); |
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.
Nice :-)
No changes in behaviour: this commit just moves the pointer-name parsing introduced in 771a153 to a function of its own. This is to prepare for a fix of diffblue#6609: the same name parsing also needs to be added to function-pointer-restriction parsing from JSON files. To enable this code move, the exception class is moved to the global scope.
This is a follow-up fix to 771a153, which added support for labels as function-pointer identifiers. That commit, however, failed to consider JSON input, and instead only resulted in support for command-line specified restrictions. Fixes: diffblue#6609
Rather than requiring users to (necessarily!) make at least two calls, just process what users actually have available (a goto model and some command line options).
27a04a5
to
73980e4
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.
Thanks for the test case, and the extra commentary. Re-asserting my approval after those additions.
/// Parse \p candidate to distinguish whether it refers to a function pointer | ||
/// symbol directly (as produced by \ref label_function_pointer_call_sites), or | ||
/// a source location via its statement label. In the latter case, resolve the | ||
/// name to the underlying function pointer symbol. |
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.
Brilliant, thanks :-)
I can confirm this solves the problem we had using restrictions files with Kani (formerly RMC). |
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
This is a follow-up fix to 771a153, which added support for
labels as function-pointer identifiers. That commit, however, failed to
consider JSON input, and instead only resulted in support for
command-line specified restrictions.
Fixes: #6609
Please review commit-by-commit.