From patchwork Wed Dec 22 01:23:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 76352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B63F4B70A4 for ; Wed, 22 Dec 2010 12:23:18 +1100 (EST) Received: (qmail 24657 invoked by alias); 22 Dec 2010 01:23:16 -0000 Received: (qmail 24649 invoked by uid 22791); 22 Dec 2010 01:23:16 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Dec 2010 01:23:11 +0000 Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id oBM1N9k9017256 for ; Tue, 21 Dec 2010 17:23:09 -0800 Received: from pzk37 (pzk37.prod.google.com [10.243.19.165]) by kpbe14.cbf.corp.google.com with ESMTP id oBM1N2Nw015693 for ; Tue, 21 Dec 2010 17:23:08 -0800 Received: by pzk37 with SMTP id 37so1379307pzk.40 for ; Tue, 21 Dec 2010 17:23:08 -0800 (PST) Received: by 10.142.203.17 with SMTP id a17mr5086809wfg.182.1292980988340; Tue, 21 Dec 2010 17:23:08 -0800 (PST) Received: from coign.google.com ([67.218.105.75]) by mx.google.com with ESMTPS id y42sm8333895wfd.22.2010.12.21.17.23.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Dec 2010 17:23:07 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Fix named results and recover Date: Tue, 21 Dec 2010 17:23:00 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The code which handled functions with named results which called recover was buggy. It assumed that the named results for the cloned function would be the same, but in fact each function has its own individual list of result variables. This patch fixes the problem. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 686314607209 go/gogo.cc --- a/go/gogo.cc Tue Dec 21 17:13:42 2010 -0800 +++ b/go/gogo.cc Tue Dec 21 17:19:03 2010 -0800 @@ -2628,7 +2628,7 @@ Function::swap_for_recover(Function *x) { gcc_assert(this->enclosing_ == x->enclosing_); - gcc_assert(this->named_results_ == x->named_results_); + std::swap(this->named_results_, x->named_results_); std::swap(this->closure_var_, x->closure_var_); std::swap(this->block_, x->block_); gcc_assert(this->location_ == x->location_);