From: Ian Lance Taylor Date: Thu, 24 Feb 2011 02:51:00 +0000 (+0000) Subject: Don't crash on bad receiver when building recover thunks. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63cc9deb7cad1672212fc84df0ca48900af236e6;p=gcc.git Don't crash on bad receiver when building recover thunks. From-SVN: r170452 --- diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index f1404cc260e..a63abfefde3 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -2205,10 +2205,14 @@ Build_recover_thunks::function(Named_object* orig_no) 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()->set_is_not_receiver(); + if (new_rec_no == NULL) + gcc_assert(saw_errors()); + else + { + gcc_assert(new_rec_no->is_variable() + && new_rec_no->var_value()->is_receiver()); + new_rec_no->var_value()->set_is_not_receiver(); + } } // Because we flipped blocks but not types, the can_recover