OSDN Git Service

Don't crash if a result variable redefines a parameter.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Feb 2011 02:43:21 +0000 (02:43 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Feb 2011 02:43:21 +0000 (02:43 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170451 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index b062c54..f1404cc 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);
     }
 }