CL 184998 added optimizations for one- and two-case select
statements. But it didn't handle break statement in the select
case correctly. Specifically, it didn't add the label definition,
so it could result in a dangling goto. This CL fixes this, by
adding the label definition.
A test case is CL 185520.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/185519
From-SVN: r273359
-7a8e10be0ddb8909ce25a264d03b24cee4df60cc
+170ecdf6b2eab8aac2b8c852fa95d3c36d6bf604
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Statement::make_block_statement(scase.statements(), scase.location());
b->add_statement(bs);
+ Statement* label =
+ Statement::make_unnamed_label_statement(this->break_label());
+ b->add_statement(label);
+
this->is_lowered_ = true;
return Statement::make_block_statement(b, loc);
}
Statement::make_if_statement(call, bchan, defcase.statements(), loc);
b->add_statement(ifs);
+ Statement* label =
+ Statement::make_unnamed_label_statement(this->break_label());
+ b->add_statement(label);
+
this->is_lowered_ = true;
return Statement::make_block_statement(b, loc);
}