JDK-8255389 : ConcurrentHashTable::NoOp omits return in non-void return method
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,15,16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-10-26
  • Updated: 2020-10-29
  • Resolved: 2020-10-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b22Fixed
Related Reports
Relates :  
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.
Comments
Changeset: dccfd2b3 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2020-10-27 08:16:43 +0000 URL: https://git.openjdk.java.net/jdk/commit/dccfd2b3
27-10-2020