projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
abff6b5
)
Don't crash on invalid call to append.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 22 Dec 2010 23:57:28 +0000
(23:57 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 22 Dec 2010 23:57:28 +0000
(23:57 +0000)
From-SVN: r168187
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index 491b71ab748cc42a02786e06bc9083a741798854..ea5821b56857f1404228083706e580bf3423a4c0 100644
(file)
--- a/
gcc/go/gofrontend/expressions.cc
+++ b/
gcc/go/gofrontend/expressions.cc
@@
-7387,8
+7387,11
@@
Builtin_call_expression::do_check_types(Gogo*)
this->report_error(_("not enough arguments"));
break;
}
- /* Lowering varargs should have left us with 2 arguments. */
- gcc_assert(args->size() == 2);
+ if (args->size() > 2)
+ {
+ this->report_error(_("too many arguments"));
+ break;
+ }
std::string reason;
if (!Type::are_assignable(args->front()->type(), args->back()->type(),
&reason))