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

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

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 11, 15, 16
    • 16
    • hotspot
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: