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

[r] Fix Rcpp warning about out-of-bounds access #123

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

bnprks
Copy link
Owner

@bnprks bnprks commented Aug 29, 2024

Rcpp started warning about out-of-bounds access stating subscript out of bounds (index 0 >= vector size 0) on some tests. This was due to length-zero arrays in BPCells matrices arising from e.g. single element arrays with perfectly compressed data arrays (0 bits per element in the bitpacking data array).

Now we avoid accessing an index of a possibly-empty array and use an alternate method to get a data pointer.

bnprks added 2 commits August 29, 2024 01:33
Rcpp started warning about out-of-bounds access, which caused some
concerning warnings with length-zero arrays in BPCells matrices
arising from e.g. single element arrays with perfectly compressed
data arrays (0 bits per element in the bitpacking data array).

Now we avoid accessing an index of a possibly-empty array and use
an alternate method to get a data pointer.
Copy link
Collaborator

@immanuelazn immanuelazn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@bnprks bnprks merged commit d409a68 into main Sep 3, 2024
@bnprks bnprks deleted the bp/bugfix-out-of-bounds branch September 3, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants