From patchwork Mon Dec 3 07:21:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 203296 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 393542C008F for ; Mon, 3 Dec 2012 18:21:49 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1355124110; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=YoqLoqB ICTfgo6JuhQdeCBNSZsk=; b=Rw6cErqs/FghwrcN0H+oWN0gq3aiW4M6dDmZL9u 1FjDyUr/ZA3AYKYkdNG2vU0WyxRcKn4KiCc4Nq19b+pIjIGFWO9tHb6p2zNEC4Sl 3WS0PRWzJP/uZkM4qu71nlrhG1RxunfMiSSp56P9zfN+FwhUhTMWV4NVo2E2oqAU gY14= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=A0e5zlcVKfeT0wHKvSvPoyN6HvMdtIqEZUlad7RHXrTPnSixod1GhMg9NbCr/g OoDpl3Bc3Z7PE+eN0AaXywH2Tdk93lJTi9XRetbDCH5rfZWOdZZEs1FSplem1jmS 3E/3R7Sl/tw4E0+fW/3Z+96cPJcrsbd7MQL87SC3/K7ZQ=; Received: (qmail 12449 invoked by alias); 3 Dec 2012 07:21:32 -0000 Received: (qmail 12428 invoked by uid 22791); 3 Dec 2012 07:21:30 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 Dec 2012 07:21:25 +0000 Received: by mail-pb0-f47.google.com with SMTP id un1so1595666pbc.20 for ; Sun, 02 Dec 2012 23:21:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=Mpn0A8ES1ygaM9IYeat6Gzb7ku41bGATaT3QK0dnSYc=; b=huyzG2N0ZCR8Mzg7qW8M1YWIrzFhLqkV+N/hlZ8ixY3ag3Uwv8ZVBds6xRzR8yos11 8fZFiCNgw81oI5T/JiO+BJBkfNoKD0bC5Ydol5nGlU8qFZwhGCwToMQUOXD0hAruTway 9cZy39wG4CBIPEdj0M3ibBrZyIJkzhtKa5GHp2Awa5+4661B/XDLtPnFjoDWIG83ziYx IQu4a4afSw9JcEVZ834l/cU9Z57lXoIag1kKBhOmvFmQQxvRdkGyFeMf1hcfdSfj1kxI VJ3xObnketWbvEmk0UBFZwv9x/j2eCPb74NtCyT0jZxRVVXigl1BknNogPJzncPmV/ZA ftAA== Received: by 10.66.79.194 with SMTP id l2mr23630138pax.68.1354519285383; Sun, 02 Dec 2012 23:21:25 -0800 (PST) Received: from coign.google.com ([2401:fa00:0:9:224:d7ff:fe8f:f634]) by mx.google.com with ESMTPS id m4sm7591753pax.16.2012.12.02.23.21.22 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Dec 2012 23:21:24 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Fix field tracking in global var initializer Date: Sun, 02 Dec 2012 23:21:19 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmmsR/iDRZ7nDQEEPUKs0mMTI/4of+OsIga4yMnl6JCEGCCo6Y9Oi1dvBmFL9VT2dMqgjF8ovZaVtCrG8ySb/Wx4ZT2RkDkOUlZn6/LidXFz9BZ8h264EfP2l2C1qr27hvAUoV63kWwDXg2yWNGXf+BMmQ7W2kTwskn8ZqwEvhTc2qiZrijvOe7REYehgzfn7sIyp3G 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 This patch to the Go compiler avoids a crash if a tracked field is referenced in the initializer for a global variable. Bootstrapped on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 879fac2f2103 go/expressions.cc --- a/go/expressions.cc Sun Dec 02 22:55:02 2012 -0800 +++ b/go/expressions.cc Sun Dec 02 23:19:27 2012 -0800 @@ -10651,7 +10651,8 @@ // them if they are not referenced. The effect is that the only // strings, indicating field references, that will wind up in the // executable will be those for functions that are actually needed. - function->func_value()->set_in_unique_section(); + if (function != NULL) + function->func_value()->set_in_unique_section(); var->set_in_unique_section(); return this;