]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't crash receiving multiple results from void function.
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 22 Dec 2010 01:28:29 +0000 (01:28 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 22 Dec 2010 01:28:29 +0000 (01:28 +0000)
From-SVN: r168157

gcc/go/gofrontend/expressions.cc

index 10aeddedc20fe698fe6655934ebf20b7ebc6d951..525ede2e76075f35d689916590d63cfe8ffd53f3 100644 (file)
@@ -8816,6 +8816,12 @@ Call_result_expression::do_type()
   if (fntype == NULL)
     return Type::make_error_type();
   const Typed_identifier_list* results = fntype->results();
+  if (results == NULL)
+    {
+      this->report_error(_("number of results does not match "
+                          "number of values"));
+      return Type::make_error_type();
+    }
   Typed_identifier_list::const_iterator pr = results->begin();
   for (unsigned int i = 0; i < this->index_; ++i)
     {