This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Fix uninitialized variable looking up '_'
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Tue, 21 Dec 2010 17:37:33 -0800
- Subject: Go patch committed: Fix uninitialized variable looking up '_'
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 -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);