Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8255389

ConcurrentHashTable::NoOp omits return in non-void return method

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 15, 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      Static analysis complains there is a non-void return method without a return statement:

        struct NoOp {
          void operator()(VALUE*) {}
          const VALUE& operator()() {} // <--- here
          void operator()(bool, VALUE*) {}
        } noOp;

      AFAICS, this is UB, and we have seen cases like these break compilers in other places. Not in this case, though, because noOp is only used as the default functor in remove. Still, it would be good to remove that risky definition, so that it is not used accidentally.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: