QB64pe icon indicating copy to clipboard operation
QB64pe copied to clipboard

_BIT arrays do not clear all bits on resize

Open flukiluke opened this issue 9 months ago • 0 comments

Describe the bug When performing REDIM _PRESERVE on an array of _BIT, bits in the same byte as a preserved bit are not cleared.

To Reproduce Test case:

REDIM a(0 TO 4) AS _BIT * 2
a(0) = -1
a(1) = -1
a(2) = -1
a(3) = -1
a(4) = -1
REDIM _PRESERVE a(0 TO 1) AS _BIT * 2
REDIM _PRESERVE a(0 TO 4) AS _BIT * 2
PRINT a(0); a(1); a(2); a(3); a(4)

Indices 2, 3, 4 should be 0 but 2 & 3 are still -1. Note that indices 0 through 3 all share a byte but a(4) is in its own byte, correctly zeroed.

flukiluke avatar Jun 01 '24 10:06 flukiluke