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

Changes to X86_64 verification. #2013

Merged
merged 3 commits into from
Jan 18, 2024
Merged

Changes to X86_64 verification. #2013

merged 3 commits into from
Jan 18, 2024

Conversation

andreistefanescu
Copy link
Contributor

Refactor code to use getPoststateObligations in both Builtins.hs and X86.hs. Fail in the case of AbortedResult in X86.hs (like in Builtins.hs). Some more changes, I think to fix a bug, but I don't remember.

Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, aside from some minor refactoring and documentation suggestions below.

C.FinishedResult _ pr -> do
gp <- getGlobalPair opts pr
mem' <- maybe
(fail "internal error: LLVM Memory global not found")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should panic instead of failing? I can't foresee the call to lookupGlobal mvar (gp ^. gpGlobals) failing unless the code itself is wrong.

mem' <- maybe
(fail "internal error: LLVM Memory global not found")
return
(C.lookupGlobal mvar $ gp ^. C.gpGlobals)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are at least two calls to lookupGlobal mvar (gp ^. gpGlobals) in this file (there's another on line 578) that in turn validate that it returns a Just value. It might be worth factoring this out into a little helper function.

Comment on lines +1697 to +1702
getPoststateObligations ::
Crucible.IsSymBackend Sym bak =>
SharedContext ->
bak ->
IORef MetadataMap ->
IO [(String, MS.ConditionMetadata, Term)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to include some Haddocks stating what this function computes. For instance, what is the String in the return type? (It's hard to know without looking at the implementation.)

@andreistefanescu andreistefanescu merged commit 8561a21 into master Jan 18, 2024
38 checks passed
@andreistefanescu andreistefanescu deleted the changes branch January 18, 2024 05:58
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.

3 participants