Remove const from Node::_idx which is modified

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: 24
    • Component/s: hotspot
    • b05

      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).

            Assignee:
            Yagmur Eren
            Reporter:
            Theo Weidmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: