Node::_idx is declared as const but it is actually modified by the setter Node::set_idx.
First, this is counterintuitive when reading the code as the reader will assume the variable can never change from only seeing the declaration.
Second, this causes undefined behavior in Node::set_idx as per the C++ standard (section 7.1.6.1.4 for C++14).
First, this is counterintuitive when reading the code as the reader will assume the variable can never change from only seeing the declaration.
Second, this causes undefined behavior in Node::set_idx as per the C++ standard (section 7.1.6.1.4 for C++14).
- relates to
-
JDK-8164632 Node indices should be treated as unsigned integers
- Open
- links to
-
Review(master) openjdk/jdk/22646