[Issue 13931] New: Missing overflow checks in `std.conv` for negative numbers which start from the most negative number digits
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jan 4 05:18:48 PST 2015
https://issues.dlang.org/show_bug.cgi?id=13931
Issue ID: 13931
Summary: Missing overflow checks in `std.conv` for negative
numbers which start from the most negative number
digits
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: verylonglogin.reg at gmail.com
This program doesn't throw but should:
---
import std.conv, std.stdio;
void main()
{
writeln("-21474836480".to!int()); // should throw
writeln("-92233720368547758080".to!long()); // should throw
}
---
--
More information about the Digitalmars-d-bugs
mailing list