From patchwork Wed Apr 24 14:18:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 239209 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 866442C00E0 for ; Thu, 25 Apr 2013 00:18:51 +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:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=ighc8YO51b9BlIUgWAOgjKy4lgx9gWSyWq4XhyDXxoiKk6caxt lnyWBsu14jQYTI5ZjO35VrThcQ7o7JHwuwds5tr+cw9I0QO8wHSQBm47bgD1CL0V XI/SH1dMHPRcpoUZLjCqzmFzQnUp2wtQtZP03DT4guNB7YapiewNTmwYU= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=USexCE+Iwq4dj8HK92k7Gxqw60I=; b=hWRb+5bKbh08YMwdj3IM WiWlIdM3vnfymcUUmvF3gdu01t7DWwixkm4WbfcLMypER4mWlQNYZsGYBPJuBrhb 2svTpL9YjkEd58hSICQXxqnMOD4bG0+OGLl4MrLpJTH2V6e3KEWYfonV7uXUd/oT rC2QFBNJCwtyXxAAIEbNcTQ= Received: (qmail 25935 invoked by alias); 24 Apr 2013 14:18:44 -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 25925 invoked by uid 89); 24 Apr 2013 14:18:44 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Apr 2013 14:18:43 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DCDDF2ED0D; Wed, 24 Apr 2013 10:18:41 -0400 (EDT) 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 aHHoh0JggkGr; Wed, 24 Apr 2013 10:18:41 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id A29B12E651; Wed, 24 Apr 2013 10:18:41 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 9FFE53FF09; Wed, 24 Apr 2013 10:18:41 -0400 (EDT) Date: Wed, 24 Apr 2013 10:18:41 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Properly initialize value of global variable Unit_Casing before use Message-ID: <20130424141841.GA15091@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Found: No In some cases, the value of global variable Unit_Casing could be read before being initialized. This is now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-04-24 Yannick Moy * repinfo.adb (List_Rep_Info): Set the value of Unit_Casing before calling subprograms which may read it. Index: repinfo.adb =================================================================== --- repinfo.adb (revision 198221) +++ repinfo.adb (working copy) @@ -114,7 +114,8 @@ Table_Name => "FE_Rep_Table"); Unit_Casing : Casing_Type; - -- Identifier casing for current unit + -- Identifier casing for current unit. This is set by List_Rep_Info for + -- each unit, before calling subprograms which may read it. Need_Blank_Line : Boolean; -- Set True if a blank line is needed before outputting any information for @@ -988,11 +989,11 @@ then for U in Main_Unit .. Last_Unit loop if In_Extended_Main_Source_Unit (Cunit_Entity (U)) then + Unit_Casing := Identifier_Casing (Source_Index (U)); -- Normal case, list to standard output if not List_Representation_Info_To_File then - Unit_Casing := Identifier_Casing (Source_Index (U)); Write_Eol; Write_Str ("Representation information for unit "); Write_Unit_Name (Unit_Name (U));