summaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/parse.cc
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 21:59:12 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 21:59:12 +0000
commit1373401e1d69aa79f2b031d58acabe35aad8b2a9 (patch)
treebb24d5d2976aba0f2dec4db00e327105e4b46cb4 /gcc/go/gofrontend/parse.cc
parent8edc9ee53be8854228d20569eee719a01a4001de (diff)
downloadgcc-1373401e1d69aa79f2b031d58acabe35aad8b2a9.tar.gz
compiler: fix test for mismatch between function results and uses
Test is http://codereview.appspot.com/111360045 . git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212830 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/gofrontend/parse.cc')
-rw-r--r--gcc/go/gofrontend/parse.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 3d60171dde2..d7d3a072040 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -1694,6 +1694,8 @@ Parse::init_vars_from_call(const Typed_identifier_list* vars, Type* type,
// the right number of values, but it might. Declare the variables,
// and then assign the results of the call to them.
+ call->set_expected_result_count(vars->size());
+
Named_object* first_var = NULL;
unsigned int index = 0;
bool any_new = false;
@@ -4101,6 +4103,7 @@ Parse::tuple_assignment(Expression_list* lhs, bool may_be_composite_lit,
{
if (op != OPERATOR_EQ)
error_at(location, "multiple results only permitted with %<=%>");
+ call->set_expected_result_count(lhs->size());
delete vals;
vals = new Expression_list;
for (unsigned int i = 0; i < lhs->size(); ++i)