diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-18 21:59:12 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-18 21:59:12 +0000 |
commit | 1373401e1d69aa79f2b031d58acabe35aad8b2a9 (patch) | |
tree | bb24d5d2976aba0f2dec4db00e327105e4b46cb4 /gcc/go/gofrontend/parse.cc | |
parent | 8edc9ee53be8854228d20569eee719a01a4001de (diff) | |
download | gcc-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.cc | 3 |
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) |