Bug 16192 – std.conv.toChars() opSlice wrong for radix other than 10

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-22T07:15:00Z
Last change time
2016-10-01T11:45:59Z
Keywords
pull
Assigned to
ag0aep6g
Creator
gorox

Comments

Comment #0 by gorox — 2016-06-22T07:15:47Z
Off by one error in std.conv.toChars() opSlice() where radix != 10. The "- 1" here is wrong and fix is removing it. result.value = value >>> ((len - upr - 1) * SHIFT); https://github.com/dlang/phobos/blob/master/std/conv.d#L5736 unittest does not try enough cases and accidentally passes on Intel. Not so on ARM. Reference: https://forum.dlang.org/thread/[email protected]
Comment #1 by ag0aep6g — 2016-06-22T20:53:32Z
Comment #2 by github-bugzilla — 2016-07-06T23:53:59Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/18c9ffc625b874d8b4e149bb4adbc3707ce08032 fix issue 16192 - std.conv.toChars() opSlice wrong for radix other than 10 https://github.com/dlang/phobos/commit/c4b397315c6d4341cf6302a07163696468a3333e Merge pull request #4489 from aG0aep6G/16192-2 fix issue 16192 - std.conv.toChars() opSlice wrong for radix other th…
Comment #3 by github-bugzilla — 2016-10-01T11:45:59Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/18c9ffc625b874d8b4e149bb4adbc3707ce08032 fix issue 16192 - std.conv.toChars() opSlice wrong for radix other than 10 https://github.com/dlang/phobos/commit/c4b397315c6d4341cf6302a07163696468a3333e Merge pull request #4489 from aG0aep6G/16192-2