RFR: 8259576: Misplaced curly brace in Matcher::find_shared_post_visit
Lutz Schmidt
lucy at openjdk.java.net
Mon Jan 11 18:51:06 UTC 2021
On Mon, 11 Jan 2021 18:37:40 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> SonarCloud demo instance reports the issue here:
>
> case Op_VectorMaskCmp: {
> n->set_req(1, new BinaryNode(n->in(1), n->in(2)));
> n->set_req(2, n->in(3));
> n->del_req(3);
> break;
> default: // <----- ERROR
> break;
> }
>
> "The direct parent of this switch-label is not the body of a switch statement."
>
> This is added by JDK-8223347, and it is an obviously misplaced curly-brace. It is innocuous in current code, but may become problematic as more cases are added to the switch.
This fix looks good (and trivial) to me.
I personally would open a separate context for a case body only if there is an actual need (decl of locals, e.g.). But that's just my taste. Not relevant at all.
-------------
Marked as reviewed by lucy (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2031
More information about the hotspot-compiler-dev
mailing list