Don't crash if a result variable redefines a parameter.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 24 Feb 2011 02:43:21 +0000 (02:43 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 24 Feb 2011 02:43:21 +0000 (02:43 +0000)
From-SVN: r170451

gcc/go/gofrontend/gogo.cc

index b062c541a698706519fbf1a1944b29abf4980814..f1404cc260ef32ba1fc3bfd6b301ad9c571a7dc4 100644 (file)
@@ -2558,7 +2558,8 @@ Function::create_named_result_variables(Gogo* gogo)
        }
       Result_variable* result = new Result_variable(p->type(), this, index);
       Named_object* no = block->bindings()->add_result_variable(name, result);
-      this->named_results_->push_back(no);
+      if (no->is_result_variable())
+       this->named_results_->push_back(no);
     }
 }