RFR: 8354433: Assert in AbstractRBTree::visit_range_in_order(const K& from, const K& to, F f) is wrong [v2]
Johan Sjölen
jsjolen at openjdk.org
Fri Apr 25 14:34:48 UTC 2025
On Fri, 25 Apr 2025 14:25:25 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:
>> There was an assert in `AbstractRBTree::visit_range_in_order` that could incorrectly trigger when:
>> - The range contains no nodes, **but**
>> - Nodes exist **outside** that range.
>>
>> The assert checked `from <= to` indirectly via `from <= start <= to`, but `start` could be valid outside that range.
>>
>> To fix this, I added the ability to supply a direct key comparison for intrusive trees to the `COMPARATOR` template. This already existed in the non-intrusive RBTree, and works the same as the other extra `cmp` function.
>>
>> Additionally, I found another wrong assert in `replace_at_cursor` that is also fixed here.
>
> Casper Norrbin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - johan feedback
> - Merge branch 'master' into rbtree-assert-fix
> - assert fix with key comparator for intrusive trees
Marked as reviewed by jsjolen (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/24658#pullrequestreview-2794345646
More information about the hotspot-runtime-dev
mailing list