← Back to index
|
Original Bugzilla link
Bug 17467 – BitArray are broken with <<= 64
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-06-04T12:08:09Z
Last change time
2017-12-18T22:56:31Z
Assigned to
No Owner
Creator
Kohei Morita
Comments
Comment #0
by moskou.moskou — 2017-06-04T12:08:09Z
---------- import std.stdio; import std.bitmanip; int main() { bool[] buf = new bool[64*3]; buf[0..64] = true; BitArray b = BitArray(buf); writeln(b); b <<= 64; writeln(b); return 0; } ---------- This code output ---------- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] ---------- More precisely, std.bitmanip.rollLeft's body ---------- return (upper << nbits) | (lower >> (bitsPerSizeT - nbits)); ---------- This is wrong when nbits = 0(ulong >> 64 is illegal).
Comment #1
by github-bugzilla — 2017-11-09T19:07:50Z
Commits pushed to master at
https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/997eb6229981bb1a28f160175c89dba0e52eae96
Fix Issue 17467 - BitArray are broken with <<= 64
https://github.com/dlang/phobos/commit/2534841d3ccc5412610a4dc85206e63faee5995f
Merge pull request #5842 from Darredevil/issue-17467-bitArray-rollLeft-rollRight Fix Issue 17467 - BitArray are broken with <<= 64 merged-on-behalf-of: Andrei Alexandrescu <
[email protected]
>
Comment #2
by github-bugzilla — 2017-12-18T22:56:31Z
Commits pushed to stable at
https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/997eb6229981bb1a28f160175c89dba0e52eae96
Fix Issue 17467 - BitArray are broken with <<= 64
https://github.com/dlang/phobos/commit/2534841d3ccc5412610a4dc85206e63faee5995f
Merge pull request #5842 from Darredevil/issue-17467-bitArray-rollLeft-rollRight