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

dfmc-llvm-back-end: Fix left shift overflow detection #1256

Merged
merged 1 commit into from
Sep 27, 2019

Conversation

housel
Copy link
Member

@housel housel commented Sep 24, 2019

This change fixes the previously-incorrect LLVM back-end
implementation of the primitive-machine-word-shift-left-signal-overflow primitive.

This fixes issue #1239.

@waywardmonkeys
Copy link
Member

Did you mean for this to include the testworks channges? They seem like a separate concern.

@housel
Copy link
Member Author

housel commented Sep 25, 2019

Yes, all other things being equal I like to commit regression tests together with the corresponding bug fixes.

@pedro-w
Copy link
Contributor

pedro-w commented Sep 25, 2019

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?

@housel
Copy link
Member Author

housel commented Sep 25, 2019

Oh, no they are not... updated.

@@ -29,7 +29,19 @@ define test bug-5954 ()
-17);
end test bug-5954;

define test bug-github-1239 ()
Copy link
Member

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.

Copy link
Member Author

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.
@housel housel merged commit 679069c into dylan-lang:master Sep 27, 2019
@housel housel deleted the fix-1239 branch October 3, 2019 21:20
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.

4 participants