Bug 20240 – BitArray inconsistently preserves bits past length

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-09-25T07:13:14Z
Last change time
2019-10-05T12:33:43Z
Keywords
pull
Assigned to
Vladimir Panteleev
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2019-09-25T07:13:14Z
//////////// test.d /////////// import std.bitmanip; void main() { BitArray ba; ba.length = 1; ba[0] = 1; ba.length = 0; ba.length = 1; assert(ba[0] == 0); // OK ba.length = 2; ba[1] = 1; ba.length = 1; ba.length = 2; assert(ba[1] == 0); // Fail } ///////////////////////////////
Comment #1 by dlang-bot — 2019-09-25T08:03:09Z
@CyberShadow created dlang/phobos pull request #7194 "BitArray fixes" fixing this issue: - Fix Issue 20240 - BitArray inconsistently preserves bits past length https://github.com/dlang/phobos/pull/7194
Comment #2 by dlang-bot — 2019-10-05T12:33:43Z
dlang/phobos pull request #7194 "BitArray fixes" was merged into master: - 01fd74a6994e0272d25525e0cae276db1e699ad5 by Vladimir Panteleev: Fix Issue 20240 - BitArray inconsistently preserves bits past length https://github.com/dlang/phobos/pull/7194