compiler: Fix varargs functions that call recover.

Also fix a couple of crashes on invalid code.

From-SVN: r184751
This commit is contained in:
Ian Lance Taylor 2012-03-01 17:11:55 +00:00
parent 0f68ba3ea3
commit f34ce44b67
2 changed files with 8 additions and 1 deletions

View File

@ -1066,6 +1066,10 @@ class Set_and_use_temporary_expression : public Expression
{ return this->expr_; }
protected:
int
do_traverse(Traverse* traverse)
{ return Expression::traverse(&this->expr_, traverse); }
Type*
do_type();

View File

@ -2500,6 +2500,9 @@ Build_recover_thunks::function(Named_object* orig_no)
Call_expression* call = Expression::make_call(fn, args, false, location);
// Any varargs call has already been lowered.
call->set_varargs_are_lowered();
Statement* s;
if (orig_fntype->results() == NULL || orig_fntype->results()->empty())
s = Statement::make_statement(call, true);
@ -5346,5 +5349,5 @@ Statement_inserter::insert(Statement* s)
else if (this->var_ != NULL)
this->var_->add_preinit_statement(this->gogo_, s);
else
go_unreachable();
go_assert(saw_errors());
}