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

Fix bug at the --threads command #6039

Merged
merged 2 commits into from May 1, 2018
Merged

Fix bug at the --threads command #6039

merged 2 commits into from May 1, 2018

Conversation

wooster0
Copy link
Contributor

@wooster0 wooster0 commented May 1, 2018

Right now when you compile with crystal myfile.cr --threads 0 then this happens:

Division by zero
???
???
???
???
???
???
???

Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://githu
b.com/crystal-lang/crystal/issues

Or when you specify something lower than 0:
crystal myfile.cr --threads -1228

Negative deque capacity: -1228
???
???
???
???
???
???
???

Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://githu
b.com/crystal-lang/crystal/issues

My crystal -v output:

Crystal 0.24.2 [4f9ed8d03] (2018-03-08)

LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu

@wooster0 wooster0 changed the title Fix bug in at the --threads command Fix bug at the --threads command May 1, 2018
@@ -462,6 +462,8 @@ class Crystal::Command
error "You have input an invalid format, only text and JSON are supported"
end

error "maximum number of threads cannot be lower than 1" if compiler.n_threads<1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, fix the formatting: compiler.n_threads < 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I forgot that. Fixed

@sdogruyol sdogruyol merged commit 9da2831 into crystal-lang:master May 1, 2018
@sdogruyol sdogruyol added this to the Next milestone May 1, 2018
chris-huxtable pushed a commit to chris-huxtable/crystal that referenced this pull request Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants