Don't delete old arguments when lowering varargs.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 24 Feb 2011 15:42:55 +0000 (15:42 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 24 Feb 2011 15:42:55 +0000 (15:42 +0000)
From-SVN: r170474

gcc/go/gofrontend/expressions.cc

index 259faa128ecae70fb9b75123b540de1fd4076c3e..cebcbca7a0760ab2921e209cf132bacd4ce053a1 100644 (file)
@@ -8281,8 +8281,9 @@ Call_expression::do_lower(Gogo* gogo, Named_object* function, int)
          for (size_t i = 0; i < rc; ++i)
            args->push_back(Expression::make_call_result(call, i));
          // We can't return a new call expression here, because this
-         // one may be referenced by Call_result expressions.  FIXME.
-         delete this->args_;
+         // one may be referenced by Call_result expressions.  We
+         // also can't delete the old arguments, because we may still
+         // traverse them somewhere up the call stack.  FIXME.
          this->args_ = args;
        }
     }