summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-22 01:37:30 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-22 01:37:30 +0000
commit7b17528592dd244b7078b7d9ed6cbe540c8a3eb0 (patch)
tree50c2edb4092ed5e7e352c92f6d1ead59d7480303
parent7b8d861ffb21920a8a15c4210ce11cce5f72fff3 (diff)
downloadgcc-7b17528592dd244b7078b7d9ed6cbe540c8a3eb0.tar.gz
Fix uninitialized variable when looking up '_'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168158 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/go/gofrontend/gogo.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index 59141fbfd6f..eb530d1eb9c 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -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);