-
Notifications
You must be signed in to change notification settings - Fork 63
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
Conversation
There was a problem hiding this 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.
src/SAWScript/Crucible/LLVM/X86.hs
Outdated
C.FinishedResult _ pr -> do | ||
gp <- getGlobalPair opts pr | ||
mem' <- maybe | ||
(fail "internal error: LLVM Memory global not found") |
There was a problem hiding this comment.
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 fail
ing? I can't foresee the call to lookupGlobal mvar (gp ^. gpGlobals)
failing unless the code itself is wrong.
src/SAWScript/Crucible/LLVM/X86.hs
Outdated
mem' <- maybe | ||
(fail "internal error: LLVM Memory global not found") | ||
return | ||
(C.lookupGlobal mvar $ gp ^. C.gpGlobals) |
There was a problem hiding this comment.
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.
getPoststateObligations :: | ||
Crucible.IsSymBackend Sym bak => | ||
SharedContext -> | ||
bak -> | ||
IORef MetadataMap -> | ||
IO [(String, MS.ConditionMetadata, Term)] |
There was a problem hiding this comment.
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.)
Refactor code to use
getPoststateObligations
in bothBuiltins.hs
andX86.hs
. Fail in the case ofAbortedResult
inX86.hs
(like inBuiltins.hs
). Some more changes, I think to fix a bug, but I don't remember.