-
Notifications
You must be signed in to change notification settings - Fork 73
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
dfmc-llvm-back-end: Fix left shift overflow detection #1256
Conversation
Did you mean for this to include the testworks channges? They seem like a separate concern. |
Yes, all other things being equal I like to commit regression tests together with the corresponding bug fixes. |
I think @waywardmonkeys is referring to the changes to the testworks submodule which you can see here - are they related to the change in hand? |
Oh, no they are not... updated. |
@@ -29,7 +29,19 @@ define test bug-5954 () | |||
-17); | |||
end test bug-5954; | |||
|
|||
define test bug-github-1239 () |
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.
Bike shedding: to me it would be better to name the test for what it does, e.g. test-shift-left-signals-overflow, and put the bug URL in a comment. Up to you though.
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.
Fair enough. Updated again.
This change fixes the previously-incorrect LLVM back-end implementation of the primitive-machine-word-shift-left-signal-overflow primitive. * sources/dfmc/llvm-back-end/llvm-primitives-machine-word.dylan (primitive-machine-word-shift-left-signal-overflow): Check for overflow by counting the number of leading bits identical to the sign bit and insuring that the shift length does not exceed this value. * sources/common-dylan/tests/regressions.dylan (test bug-github-1239): New regression test for ash() overflow detection failures.
This change fixes the previously-incorrect LLVM back-end
implementation of the primitive-machine-word-shift-left-signal-overflow primitive.
This fixes issue #1239.