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

Properly extend path condition for llvm_conditional_points_to #1992

Merged
merged 2 commits into from Dec 15, 2023

Conversation

RyanGlScott
Copy link
Contributor

This PR:

  • Adds a ReaderT component to the OverrideMatcher' monad transformer, where the reader portions are represented with the new OverrideEnv' data type. Currently, the only field of OverrideEnv' is _oeConditionalPred, which is used to represent a path condition for any assumptions or assertions created in a specification. See Note [oeConditionalPred] for a lengthier explanation.
  • Leverages _oeConditionalPred to make llvm_conditional_points_to cond ptr val properly extend the path condition with cond before matching val against the value that ptr points to.

Fixes #1945.

@RyanGlScott RyanGlScott mentioned this pull request Dec 6, 2023
@RyanGlScott RyanGlScott added ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully. and removed ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully. labels Dec 15, 2023
This patch adds a `ReaderT` component to the `OverrideMatcher'` monad
transformer, where the reader portions are represented with the new
`OverrideEnv'` data type. Currently, the only field of `OverrideEnv'` is
`_oeConditionalPred`, which is used to represent a path condition for any
assumptions or assertions created in a specification. See `Note
[oeConditionalPred]` for a lengthier explanation.

While introducing this does require a fair bit of refactoring, this patch in
isolation does not change any user-visible behavior. In a subsequent commit, we
will leverage `oeConditionalPred` to introduce a fix for #1945.
This leverages the newly introduced `withConditionalPred` function (see the
parent commit) to make `llvm_conditional_points_to cond ptr val` properly
extend the path condition with `cond` before matching `val` against the value
that `ptr` points to.

Fixes #1945.
@RyanGlScott RyanGlScott merged commit 9d68017 into master Dec 15, 2023
38 checks passed
@RyanGlScott RyanGlScott deleted the T1945 branch December 15, 2023 08:41
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

Successfully merging this pull request may close these issues.

llvm_conditional_points_to in postcondition does not respect condition
1 participant