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
This commit is contained in:
Ian Lance Taylor 2012-03-28 21:33:15 +00:00
parent 2310e4504d
commit 552ab9772f
2 changed files with 3 additions and 1 deletions

View File

@ -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:

View File

@ -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);