Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
select_support_mcl::init_fast
would sometimes crash because the initialization tried to access the padding after the bitvector (see simongog#402). This PR fixes the issue.In the example,
pos_of_last_arg_in_the_block
is 25587424, which is greater than the length of the bitvector (25587416).The relevant part of the code is here: https://github.com/simongog/sdsl-lite/blob/c32874cb2d8524119f25f3b501526fe692df29f4/include/sdsl/select_support_mcl.hpp#L287-L308
args_in_the_word()
may find nonexistent args in the padding, at least forselect_support_mcl<0, 0>
.arg_position
on line 289.arg_position
as a candidate forpos_of_last_arg_in_the_block
.ii < v->size()
.pos_of_last_arg_in_the_block
.We can fix this by adding
cnt_new = std::min(cnt_new, m_arg_cnt);
after line 287.