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: signed integer overflow #1610

Closed

Conversation

illusory0x0
Copy link
Contributor

@illusory0x0 illusory0x0 commented Feb 7, 2025

The main difficulty in fixing this bug is locating it.
If we need to separate pull requests, I'll do that, but the process of fixing bugs is unlikely to be separated.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 5221

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 4 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 85.775%

Files with Coverage Reduction New Missed Lines %
builtin/iter.mbt 2 84.62%
Totals Coverage Status
Change from base Build 5218: -0.03%
Covered Lines: 5439
Relevant Lines: 6341

💛 - Coveralls

@illusory0x0
Copy link
Contributor Author

illusory0x0 commented Feb 7, 2025

this is another issus.

D:\a\core\core\target\native\debug\test\builtin\builtin.blackbox_test.c(198789): error C2124: divide or mod by zero

@Guest0x0
Copy link
Contributor

the -fwrapv flag should be passed to C compiler when compiling C generated by MoonBit. So signed integer overflow is not UB in MoonBit. But the hasher should indeed use UInt instead of Int, so that part may still be an improvement (in terms of code readability)

@Lampese Lampese requested a review from tonyfettes February 11, 2025 05:54
@illusory0x0
Copy link
Contributor Author

FTR: gcc option -fwrapv

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.

3 participants