public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Avoid uninitialized variable in Pop_End_Context
@ 2013-04-12 13:11 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2013-04-12 13:11 UTC (permalink / raw)
  To: gcc-patches; +Cc: Bob Duff

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

This patch initializes the top Sloc in the scope stack, which is read in
Pop_End_Context and was previously uninitialized.

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-04-12  Bob Duff  <duff@adacore.com>

	* par-ch7.adb (P_Package): Initialize Sloc in the newly-pushed scope
	stack entry.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 1282 bytes --]

Index: par-ch7.adb
===================================================================
--- par-ch7.adb	(revision 197897)
+++ par-ch7.adb	(working copy)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-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- --
@@ -138,6 +138,7 @@
          end if;
 
          T_Body;
+         Scope.Table (Scope.Last).Sloc := Token_Ptr;
          Name_Node := P_Defining_Program_Unit_Name;
          Scope.Table (Scope.Last).Labl := Name_Node;
          TF_Is;
@@ -182,6 +183,7 @@
       --  Cases other than Package_Body
 
       else
+         Scope.Table (Scope.Last).Sloc := Token_Ptr;
          Name_Node := P_Defining_Program_Unit_Name;
          Scope.Table (Scope.Last).Labl := Name_Node;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-12 12:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-12 13:11 [Ada] Avoid uninitialized variable in Pop_End_Context Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).