Bug 3352 – RangeError in std.conv

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-09-30T03:58:00Z
Last change time
2015-06-09T01:26:47Z
Assigned to
nobody
Creator
dfj1esp02

Comments

Comment #0 by dfj1esp02 — 2009-09-30T03:58:10Z
--- wtext(int.max); --- [email protected](2526): Range violation Unittests in std.conv don't test wstring and big numbers.
Comment #1 by dfj1esp02 — 2009-10-01T07:43:35Z
Also I think, it's an overkill to fine tune allocation as it's done in to!string(uint)
Comment #2 by andrei — 2009-10-01T11:05:40Z
(In reply to comment #1) > Also I think, it's an overkill to fine tune allocation as it's done in > to!string(uint) BTW I just improved optimization by adding preallocated strings for numbers between -1 and -9.
Comment #3 by dfj1esp02 — 2009-10-05T06:59:13Z
The bug is in line 2526 where Char.sizeof * maxlength is allocated but only maxlength is sliced for the buffer.
Comment #4 by andrei — 2009-10-05T18:39:56Z
(In reply to comment #3) > The bug is in line 2526 where Char.sizeof * maxlength is allocated but only > maxlength is sliced for the buffer. Thanks! I just fixed the bug and checked in.