-
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
Track and check alignment for memory regions in llvm overrides #637
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.
thank you for splitting this in multiple commits, it was easy to review :-)
Just a -> do | ||
when (a < memTyAlign) $ fail $ unlines | ||
[ "User error: manually-specified alignment was less than needed" | ||
, "Needed for this type: " ++ show memTyAlign |
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.
maybe show both memTy
and memTyAlign
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.
good idea
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.
See revision 950f106
f35ef75
to
cfead3e
Compare
let's add the test from https://github.com/GaloisInc/saw-script/tree/issue633 |
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.
looks good, thank you!
It's not quite ready, as it appears there is a bug in crucible-llvm's |
Yeah, the check is broken into two phases. The |
It turns out that saw-script is not calling |
liftIO $ | ||
Crucible.isAllocatedAlignedPointer sym w alignment mut ptr (Just psz') mem | ||
let msg = | ||
"Pointer not valid:" |
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's unfortunate that we can't have a more specific diagnosis here. The tradeoff for a better API on the Crucible side seems to be that we and
more predicates together, losing some granularity in the assertions.
This contains a fix for #635. I'm making a PR now for the automated tests, but I want to also implement a fix for #633 on this branch before it's ready to merge.