fix some vlub non monotonic behavior#489
Conversation
|
I agree it would be nice to have fewer irregularities in the value analysis. However, the proposed change (which is actually a revert to what an early version of the value analysis did) is not acceptable because it triggers unwanted optimizations when absolute addresses are used. (For various reasons, authors of embedded systems love to hard-code addresses as integer constants in their code, even though this is completely undefined behavior.) Consider: With the proposed fix, It should be possible to improve value analysis while keeping it suitably conservative, but the abstract domain of values, esp. the many roles of |
|
Indeed. I had been working on something more ambitious which, as you say, splits the roles of |
|
I gave it a try in #490. Also tried to simplify the management of provenance information. |
Previously,
vlub (Ifptr Pbot) (I i)producedIfptr Ptopifva_strict ttwas false, yetvlub (Ifptr Pbot) (Ifptr bot)wasIfptr Pbot.Not only this was non-monotonic, it also resulted in integer sequences (
i=0, 1, …) being over-approximated byIfptr Ptop, as opposed toIfptr Pbot. This in turn resulted in e.g. being unable to conclude thatt+iwasNonstackiftwasNonstack.Note: there remain some non-monotonic behaviors in
vlub, which I have not fixed.