summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-28 21:33:15 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-28 21:33:15 +0000
commit552ab9772fb2bb59f2e3d3706f2cd304e95c8741 (patch)
tree711e70281d3f1346e7edb5ee9f977e38586cbbeb /gcc
parent2310e4504dd63b79f8062abf1f33321416ad92c8 (diff)
downloadgcc-552ab9772fb2bb59f2e3d3706f2cd304e95c8741.tar.gz
compiler: fix crashes.
The compiler would crash on: if true || x, y := 1, 2 {} and var s string s = append(s, "hello") Reported in issue 3186. From-SVN: r185928
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/expressions.cc2
-rw-r--r--gcc/go/gofrontend/parse.cc2
2 files changed, 3 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 4c493f87665..f2a81de8add 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -7441,6 +7441,8 @@ Builtin_call_expression::check_one_arg()
void
Builtin_call_expression::do_check_types(Gogo*)
{
+ if (this->is_error_expression())
+ return;
switch (this->code_)
{
case BUILTIN_INVALID:
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 1a9c153a578..7207db58d0d 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -3971,7 +3971,7 @@ Parse::if_stat()
bool saw_simple_stat = false;
Expression* cond = NULL;
- bool saw_send_stmt;
+ bool saw_send_stmt = false;
if (this->simple_stat_may_start_here())
{
cond = this->simple_stat(false, &saw_send_stmt, NULL, NULL);