Skip to content

value_sett::make_member is unsound wrt struct casts #3569

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

Closed
smowton opened this issue Dec 14, 2018 · 0 comments
Closed

value_sett::make_member is unsound wrt struct casts #3569

smowton opened this issue Dec 14, 2018 · 0 comments

Comments

@smowton
Copy link
Contributor

smowton commented Dec 14, 2018

Faced with an expression like ((struct X)some_struct_y).a, value-set's make_member function will reduce that unsoundly to some_struct_y.a, here: https://github.com/diffblue/cbmc/blob/develop/src/pointer-analysis/value_set.cpp#L1654

Clearly that only works when the two structs happen to have the same layout and names.

Expressions like that are hard to get from C, but value_set_dereferencet will produce them when it different struct types are aliased.

#3562 may offer a solution, by soundly simplifying member-of-cast-of-struct-typed-expression when possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant