OSDN Git Service

Fix uninitialized variable when looking up '_'.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Dec 2010 01:37:30 +0000 (01:37 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Dec 2010 01:37:30 +0000 (01:37 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168158 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index 59141fb..eb530d1 100644 (file)
@@ -415,6 +415,9 @@ Gogo::current_block()
 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 @@ Gogo::lookup(const std::string& name, Named_object** pfunction) const
        }
     }
 
-  if (pfunction != NULL)
-    *pfunction = NULL;
-
   if (this->package_ != NULL)
     {
       Named_object* ret = this->package_->bindings()->lookup(name);