Correct handling of methods which call recover.

From-SVN: r168132
This commit is contained in:
Ian Lance Taylor 2010-12-21 21:14:15 +00:00
parent 059e2a26f5
commit 686875c172
2 changed files with 4 additions and 10 deletions

View File

@ -8630,6 +8630,7 @@ Call_expression::do_get_tree(Translate_context* context)
pe != this->args_->end();
++pe, ++pp, ++i)
{
gcc_assert(pp != params->end());
tree arg_val = (*pe)->get_tree(context);
args[i] = Expression::convert_for_assignment(context,
pp->type(),

View File

@ -2093,14 +2093,6 @@ Build_recover_thunks::function(Named_object* orig_no)
Expression* fn = Expression::make_func_reference(new_no, closure, location);
Expression_list* args = new Expression_list();
if (orig_fntype->is_method())
{
Named_object* rec_no = gogo->lookup(receiver_name, NULL);
gcc_assert(rec_no != NULL
&& rec_no->is_variable()
&& rec_no->var_value()->is_parameter());
args->push_back(Expression::make_var_reference(rec_no, location));
}
if (new_params != NULL)
{
// Note that we skip the last parameter, which is the boolean
@ -2153,10 +2145,11 @@ Build_recover_thunks::function(Named_object* orig_no)
&& !orig_rec_no->var_value()->is_receiver());
orig_rec_no->var_value()->set_is_receiver();
Named_object* new_rec_no = new_bindings->lookup_local(receiver_name);
const std::string& new_receiver_name(orig_fntype->receiver()->name());
Named_object* new_rec_no = new_bindings->lookup_local(new_receiver_name);
gcc_assert(new_rec_no != NULL
&& new_rec_no->is_variable()
&& !new_rec_no->var_value()->is_receiver());
&& new_rec_no->var_value()->is_receiver());
new_rec_no->var_value()->set_is_not_receiver();
}