OSDN Git Service

compiler: Fix varargs functions that call recover.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Mar 2012 17:11:55 +0000 (17:11 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Mar 2012 17:11:55 +0000 (17:11 +0000)
Also fix a couple of crashes on invalid code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184751 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 6672b68..0a3f205 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 acc9231..ca57aea 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());
 }