-
Notifications
You must be signed in to change notification settings - Fork 59
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
checksafety: better handling of integer shift operators #322
Conversation
Just rebased to fix the merge conflicts in the CHANGELOG. |
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.
I don't know the safety check, the changes seem reasonable, but I'd like to understand a bit what you did.
| E.Olsl (Op_w _) -> AB_Wop (Wshift Unsigned_left) | ||
| E.Olsl Op_int -> AB_Unknown | ||
| E.Oasr (Op_w _) -> AB_Wop (Wshift Signed_right) | ||
| E.Oasr Op_int -> AB_Unknown |
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.
Why do we need to distinguish Op_w
and Op_int
here? And not for other operations?
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.
I don’t know. Could you provide an example in which not doing this distinction is a problem?
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.
No, I'm trying to understand what you did.
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.
Anyway, this is stricter than before...
| Papp2 (Olsl Op_int, e1, e2) -> | ||
obind2 zlsl | ||
(aeval_cst_zint abs e1) (aeval_cst_zint abs e2) | ||
|
||
| Papp2 (Oasr Op_int, e1, e2) -> |
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.
Why is there nothing for Olsr
? Just not done yet?
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 is no lsr
on int
.
This avoids a few crashes
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.
I don't know the safety checker well, so I cannot say that the changes are right, but they are reasonable.
Fixes #319
(The first commit is unrelated, but it does not deserves a PR on its own.)
CI: https://gitlab.com/jasmin-lang/jasmin/-/pipelines/738147944