diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2010-12-22 01:28:29 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2010-12-22 01:28:29 +0000 |
commit | 428f5f5f35c00656af3ea45664b63b25fa266b9d (patch) | |
tree | 61867664630ba7e674d73b1aea98c336fd0a2347 | |
parent | 0cb04e3af791095b7082327bf8dbbfeddd871631 (diff) | |
download | gcc-428f5f5f35c00656af3ea45664b63b25fa266b9d.zip gcc-428f5f5f35c00656af3ea45664b63b25fa266b9d.tar.gz gcc-428f5f5f35c00656af3ea45664b63b25fa266b9d.tar.bz2 |
Don't crash receiving multiple results from void function.
From-SVN: r168157
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 10aedde..525ede2 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -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) { |