projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ca93cc
)
Don't crash on erroneous named result.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 3 Mar 2011 00:54:42 +0000
(
00:54
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 3 Mar 2011 00:54:42 +0000
(
00:54
+0000)
From-SVN: r170633
gcc/go/gofrontend/gogo-tree.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/gogo-tree.cc
b/gcc/go/gofrontend/gogo-tree.cc
index 883b5b118469f7abf7ef28198f6781b19164f9aa..83488fc83e7e282033ab7e6d06da83092c42d500 100644
(file)
--- a/
gcc/go/gofrontend/gogo-tree.cc
+++ b/
gcc/go/gofrontend/gogo-tree.cc
@@
-1786,8
+1786,14
@@
Function::return_value(Gogo* gogo, Named_object* named_function,
// defer statements, the result variables may be unnamed.
bool is_named = !results->front().name().empty();
if (is_named)
- gcc_assert(this->named_results_ != NULL
- && this->named_results_->size() == results->size());
+ {
+ gcc_assert(this->named_results_ != NULL);
+ if (this->named_results_->size() != results->size())
+ {
+ gcc_assert(saw_errors());
+ return error_mark_node;
+ }
+ }
tree retval;
if (results->size() == 1)