diff mbox

Go patch committed: Fix uninitialized variable looking up '_'

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

Commit Message

Ian Lance Taylor Dec. 22, 2010, 1:37 a.m. UTC
This patch to the Go frontend fixes an uninitialized variable when
looking up the special name '_'.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 931747c66dfc go/gogo.cc
--- a/go/gogo.cc	Tue Dec 21 17:27:30 2010 -0800
+++ b/go/gogo.cc	Tue Dec 21 17:34:02 2010 -0800
@@ -415,6 +415,9 @@ 
 Named_object*
 Gogo::lookup(const std::string& name, Named_object** pfunction) const
 {
+  if (pfunction != NULL)
+    *pfunction = NULL;
+
   if (Gogo::is_sink_name(name))
     return Named_object::make_sink();
 
@@ -431,9 +434,6 @@ 
 	}
     }
 
-  if (pfunction != NULL)
-    *pfunction = NULL;
-
   if (this->package_ != NULL)
     {
       Named_object* ret = this->package_->bindings()->lookup(name);