RFR: 8255389: ConcurrentHashTable::NoOp omits return in non-void return method [v2]
Kim Barrett
kbarrett at openjdk.java.net
Mon Oct 26 22:59:23 UTC 2020
On Mon, 26 Oct 2020 19:07:32 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> 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
Marked as reviewed by kbarrett (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/863
More information about the hotspot-dev
mailing list