This was caught by ASAN. Our algorithm header has many one-liners that compute the "next power of two length / 2" but they all have the caveat that if the input is already POT, then the "/ 2" part does not occur. Usually we deal with this by testing the difference against zero. However in `partition_point` we were skipping the test, thus causing a potential out-of-bounds access. I fixed `partition_point` and added a few more tests for non-POT cases.
8.0 KiB
8.0 KiB