RFR: 8255389: ConcurrentHashTable::NoOp omits return in non-void return method [v2]
Aleksey Shipilev
shade at openjdk.java.net
Mon Oct 26 19:07:32 UTC 2020
> 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`, which does not use this getter-like definition. Still, it would be good to remove that risky definition, so that it is not used accidentally.
Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
Implement suggestions from review
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/863/files
- new: https://git.openjdk.java.net/jdk/pull/863/files/e1c6727d..1154fea6
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=863&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=863&range=00-01
Stats: 9 lines in 1 file changed: 1 ins; 4 del; 4 mod
Patch: https://git.openjdk.java.net/jdk/pull/863.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/863/head:pull/863
PR: https://git.openjdk.java.net/jdk/pull/863
More information about the hotspot-dev
mailing list