diff mbox

Go patch committed: Don't crash on result variable redefinition

Message ID mcripwa17at.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Feb. 24, 2011, 2:43 a.m. UTC
This patch to the Go frontend avoids crashing if a result variable
redefines a parameter.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r b7e7cc313154 go/gogo.cc
--- a/go/gogo.cc	Tue Feb 22 21:52:37 2011 -0800
+++ b/go/gogo.cc	Wed Feb 23 18:38:36 2011 -0800
@@ -2558,7 +2558,8 @@ 
 	}
       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);
     }
 }