compiler: Fix varargs functions that call recover.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 1 Mar 2012 17:11:55 +0000 (17:11 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 1 Mar 2012 17:11:55 +0000 (17:11 +0000)
Also fix a couple of crashes on invalid code.

From-SVN: r184751

gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/gogo.cc

index 6672b684e47d9e00e3cdd5cc213db75f54eb6302..0a3f2050dd4ab7c3562f363fb3437787fa2e4962 100644 (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();
 
index acc92317dcc53bedb4f57521c2b532a161038a4f..ca57aea26ee20ac2bcfc74ee914e29567d82c847 100644 (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());
 }