Don't crash receiving multiple results from void function.

From-SVN: r168157
This commit is contained in:
Ian Lance Taylor 2010-12-22 01:28:29 +00:00
parent 0cb04e3af7
commit 428f5f5f35
1 changed files with 6 additions and 0 deletions

View 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)
{