Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_BIT arrays do not clear all bits on resize #498

Open
flukiluke opened this issue Jun 1, 2024 · 0 comments
Open

_BIT arrays do not clear all bits on resize #498

flukiluke opened this issue Jun 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@flukiluke
Copy link
Contributor

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 flukiluke added the bug Something isn't working label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant