-
Notifications
You must be signed in to change notification settings - Fork 76
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
Read offsets separately in eval_rv_base for pointer dereference #935
Conversation
Move tests to avoid collision with other tests in already filled regression test folders.
When the list of malloc-wrappers is provided to Goblint, this also fixes the issue of warnings for no suitable function existing for dynamic function calls dereferencing pointers with some field offset, e.g.:
There remain four cases of |
This replaces one |
A bit surprisingly there's no effect: I guess |
Thanks for benchmarking this! Good to know that it does in general not have a negative impact on performance. |
This PR changes the treatment of pointer dereference
eval_rv_base
and theStructs.get
method, to avoid producing top in the cases described in #716.The change affects the case that
eval_rv_base
evaluates a pointer that is dereferenced and some offset is taken from the resulting value. Previously, all objects that the pointer could point to without the offset. Then, these memory objects were joined, and the offset was taken from the result. This led to additional imprecision in case of the join of e.g. structs of different type.Now,
eval_rv_base
will look at all the possible target addresses, and read for each of them the value at the offset. Then, the values at the offsets are joined, to produce the result.The struct domain is changed such that
get
yields atop_value
of the corresponding type, rather than'Top
. This way, if a field of pointer type is requested, but the abstract value does not contain the field, a top pointer ({?, NULL}
) is constructed instead of'Top
. By avoiding to produce the'Top
in this case, addresses are read from structs of the appropriate type are kept in the result of the join.Closes #716.