From patchwork Tue Jan 29 14:18:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 216549 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 A45442C0093 for ; Wed, 30 Jan 2013 01:18:52 +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=1360073933; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=pl92kivke1ulKMK/EX5c qRWjD9U=; b=cqQftq+YWi4Fw4mvQ7EEVWoAmWuisF9HpTbfgELizLoeFSb/5cQ9 AteBSzjxJjxhQuP/yM5saF4wlg2pbGDzHZ8ajxQ1jmmODgD3hio4sP2b1GWw47A0 0Ch6+bRHSR6+3WYI3gcTcwyBVwUQvhRjW70Hc2cjGF0dPt2scxuDoKU= 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:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wNS0pmzukNy0JRvq37yTSFkmeggAEBZA2OLw2BQNCP0CF1xir0APa51u5/0NgU z3FllQouPiLr10LBm3S7tOufX1dRl5YB6yxdDVKbTSGYMkP4Da/7zJWSvgMdwq+z 8J7sKzZo3YP/FqJXlKkRQbno1+SLPD6pDiu+vC5alVP64=; Received: (qmail 10010 invoked by alias); 29 Jan 2013 14:18:19 -0000 Received: (qmail 9926 invoked by uid 22791); 29 Jan 2013 14:18:16 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL, BAYES_50, KHOP_SPAMHAUS_DROP, RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Jan 2013 14:18:06 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9E7102E718; Tue, 29 Jan 2013 09:18:05 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZV6R0BRRKHPd; Tue, 29 Jan 2013 09:18:05 -0500 (EST) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 60EBC2E716; Tue, 29 Jan 2013 09:18:05 -0500 (EST) Received: by kwai.gnat.com (Postfix, from userid 4192) id 4A614919E3; Tue, 29 Jan 2013 09:18:05 -0500 (EST) Date: Tue, 29 Jan 2013 09:18:05 -0500 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] gnat stub -P crashes when Ada is not a language of the project Message-ID: <20130129141805.GA26078@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 prevents the GNAT driver from crashing when it is called as "gnat stub -P ..." and Ada is not one of the languages of the project, for example if the project is an aggregate project. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-29 Vincent Celier * gnatcmd.adb: For "gnat stub -P ...", do not check the naming scheme for Ada, when Ada is not a language for the project. Index: gnatcmd.adb =================================================================== --- gnatcmd.adb (revision 195535) +++ gnatcmd.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2013, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2477,7 +2477,9 @@ -- the file name ends with the spec suffix, then indicate to -- gnatstub the name of the body file with a -o switch. - if not Is_Standard_GNAT_Naming (Lang.Config.Naming_Data) then + if Lang /= No_Language_Index + and then not Is_Standard_GNAT_Naming (Lang.Config.Naming_Data) + then if File_Index /= 0 then declare Spec : constant String :=