Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix Issue 14785 - Some corner cases are not handled properly by core.checkedint. #1365

Merged
merged 1 commit into from Sep 6, 2015

Conversation

tsbockman
Copy link
Contributor

This pull request fixes druntime Issue #14785.

/** Test cases that fail without this PR **/

import core.checkedint;
void main(string[] args)
{
    bool overflow = false;
    assert(subs(-1L, long.min, overflow) == long.max);
    assert(!overflow); // Assertion failure

    overflow = false;
    assert(muls(-1L, long.min, overflow) == long.min); // Floating Point Exception!
    assert(overflow);
}

@DmitryOlshansky
Copy link
Member

Please squash the commits, really no point in having a separate entry for the whitespace fix

@tsbockman
Copy link
Contributor Author

@DmitryOlshansky OK. I fixed the commit history.

Any non-whitespace related comments?

@tsbockman tsbockman mentioned this pull request Sep 5, 2015
@burner
Copy link
Member

burner commented Sep 5, 2015

LGTM

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

DmitryOlshansky added a commit that referenced this pull request Sep 6, 2015
Fix Issue 14785 - Some corner cases are not handled properly by core.checkedint.
@DmitryOlshansky DmitryOlshansky merged commit acb8611 into dlang:master Sep 6, 2015
@tsbockman tsbockman deleted the issue_14785 branch September 12, 2015 04:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants