Skip to content
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

Fix refinement in baseInvariant for more complicated lvals #1701

Merged
merged 2 commits into from
Mar 3, 2025

Conversation

michael-schwarz
Copy link
Member

@michael-schwarz michael-schwarz commented Feb 28, 2025

This is a follow-up to #1659 which was incorrect as demonstrated by the nightly SV-COMP run.

The offset handling was slightly off there, leading to points-to sets becoming empty when they should not. The correct thing is to:

  • From an Mem (Lval lv), off pair, take the Lval lv part (including any possible offsets it may have), and consider all the values of those separately by
    • Refining the value for Lval lv in base
    • Evaluating Mem (Lval lv), off w.r.t. to this new state (for technical reasons computed by appending off to the value of Lval lv - queries use stale values).
    • Setting the result to the meet, resp. raise Deadcode if it is bot.

I did not test all cases, but the unsoundness is fixed and all the BothBranchesDead ones I tested as well, so I would suggest to merge this right away, as the current state is broken.

@michael-schwarz michael-schwarz merged commit d42cc11 into master Mar 3, 2025
16 of 18 checks passed
@michael-schwarz michael-schwarz deleted the pr_1659_repair branch March 3, 2025 09:35
@sim642 sim642 added this to the v2.6.0 milestone Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants