-
Notifications
You must be signed in to change notification settings - Fork 87
Refactor writing to pointers #1531
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
base: master
Are you sure you want to change the base?
Conversation
|
Decisions from GobCon on 09.07:
|
|
We already have the option |
|
This seems to have gotten stuck. Are there plans here? |
|
There was the matter of naming/describing the option but we discussed it and something seems to have been implemented. Not sure about the test failures though. I think it makes sense to do this though. |
| assert (not @@ AD.is_empty lval); | ||
| AD.fold (fun addr acc -> D.join (update_one addr st) acc) lval (D.bot ()) |
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.
[...] Not sure about the test failures though.
The old CI runs seem to be gone, but I now merged master into this and locally at least two malloc_null tests fail.
The path-sensitivity of malloc_null analysis causes a scenario where a path has the malloc-ed pointer as {NULL}. Writing into that pointer, the assert doesn't fail because the points-to set is non-empty, but due to assume_none we end up returning D.bot ().
That bottom is a strange value: it appears live, but has lost all local variables state of base.
I suppose turning a D.bot () result into raise Deadcode could work here.
It does reveal a certain asymmetry with assume_none on NULL pointer reading: the latter doesn't raise Deadcode I think, but just assumes nothing changed.
BaseAnalysis: Investigate whyjoinover alternatives for non-definite AD target does not work #1465, and replaces complicated set logic with simplified AD.fold, for that:lval-s is not empty when written toNullPtr-s from address sets incollect_invalidateandreachable_from_valueMayPointTois not subset ofReachableFrom#1175stdlib.hfor correctly importing strtolUnknownPtrbefore callingreachable_varsinReachableFromMayPointTois not subset ofReachableFrom#1175TODO