compiler: initialize saw_send_stmt locals
authorIan Lance Taylor <iant@golang.org>
Tue, 22 Dec 2020 21:50:18 +0000 (13:50 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 22 Dec 2020 22:46:58 +0000 (14:46 -0800)
The C++ compiler wasn't warning because we take their address.

Fixes golang/go#43252

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/279752

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/parse.cc

index c70b60c657fc393c7f0468fc30cccde74baf1f3f..e67aa3622fb64f30afe917bd38b0c74b547833c6 100644 (file)
@@ -1,4 +1,4 @@
-d091cd25a5894ac751fe1868197648fc486cf322
+013a4ddcae2e8b840561c4411bab87f4f0f9ef42
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 3b2e5a7aa86c7a7043ffbf495b179f8b76c64b43..1664fe36c281648095eb12a3a135c9dd02de59b2 100644 (file)
@@ -4491,7 +4491,7 @@ Parse::switch_stat(Label* label)
 
   bool saw_simple_stat = false;
   Expression* switch_val = NULL;
-  bool saw_send_stmt;
+  bool saw_send_stmt = false;
   Type_switch type_switch;
   bool have_type_switch_block = false;
   if (this->simple_stat_may_start_here())
@@ -5326,7 +5326,7 @@ Parse::for_stat(Label* label)
        {
          // We might be looking at a Condition, an InitStat, or a
          // RangeClause.
-         bool saw_send_stmt;
+         bool saw_send_stmt = false;
          cond = this->simple_stat(false, &saw_send_stmt, &range_clause, NULL);
          if (!this->peek_token()->is_op(OPERATOR_SEMICOLON))
            {