hungarian-algorithm-n3 icon indicating copy to clipboard operation
hungarian-algorithm-n3 copied to clipboard

bitset_create() this->next array start from wrong address

Open Matti-Lehtonen opened this issue 3 years ago • 0 comments

The function uses a single allocation for three separate array. One array of c times BitSetLimb, and two arrays of (c+1) times size_t.

When the starting address of this->next is calculated, there are used: c times BitSetLimb plus only c times size_t. Now arrays this->prev and this->next are overlapping by one size_t.

I would expect that correct starting address is : this->next = (size_t *)&this->_buf[c * sizeof(BitSetLimb) + (c+1) * sizeof(size_t)];

Matti-Lehtonen avatar Jun 11 '21 06:06 Matti-Lehtonen