From patchwork Fri Aug 9 10:54:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 265988 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 529FA2C0090 for ; Fri, 9 Aug 2013 20:54:13 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:mime-version:message-id:content-type; q=dns; s= default; b=cGeRznYWCP+DrZ061w6n+pLj3ldbp8w1NU5PSjIr8nKPwOYb0GGD3 5h6oyRiQXwuZrx5NztxWfRcYNBbDNVN49notBkUEAD9frOnBeaS+aKg1WhPo+s0n elqXvAOhroSR7WKDE9MCae6IJ8LMO4nv3xeRfI8i59HEQ45iAIE7Vk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:mime-version:message-id:content-type; s= default; bh=xuz/o6QCDrKKwDgzWLKHh9JmaK0=; b=Wva0nLSbCeGyR5uccLru a77K7318BTX//gmwmVWKtdhwV3WPLP17PKpXm8k4UJ8TidFwCPV5EiS+dL6jV0lC a5rpxH/6rT6T/j0MUPm3NaR+I9P3cA12+o0UpVXiylQIwsScrfYCeL5jA54j2eRn 13tO5mRDTr0i3a7IqL9R8Ms= Received: (qmail 23878 invoked by alias); 9 Aug 2013 10:54:06 -0000 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 Received: (qmail 23868 invoked by uid 89); 9 Aug 2013 10:54:06 -0000 X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_50, RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 09 Aug 2013 10:54:05 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id D69CA265A583 for ; Fri, 9 Aug 2013 12:53:57 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VG0m23VWdM1Z for ; Fri, 9 Aug 2013 12:53:57 +0200 (CEST) Received: from hermes.site (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id AD374265A57E for ; Fri, 9 Aug 2013 12:53:57 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [c-family] Minor tweak to -fdump-ada-spec Date: Fri, 9 Aug 2013 12:54:23 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34.10-0.6-desktop; KDE/4.4.4; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201308091254.23855.ebotcazou@adacore.com> X-Virus-Found: No This fixes a segfault on specific C++ code using when -fdump-ada-spec is passed to the compiler. Tested on x86_64-suse-linux, applied on the mainline and 4.8 branch as obvious. 2013-08-09 Arnaud Charlet * c-ada-spec.c (print_ada_declaration): Prevent accessing null asm name Index: c-ada-spec.c =================================================================== --- c-ada-spec.c (revision 201592) +++ c-ada-spec.c (working copy) @@ -2900,7 +2900,7 @@ print_ada_declaration (pretty_printer *b pp_string (buffer, " -- "); dump_sloc (buffer, t); - if (is_abstract) + if (is_abstract || !DECL_ASSEMBLER_NAME (t)) return 1; newline_and_indent (buffer, spc);