This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Fix bad cases of incorrect modified xref entries


The May_Be_Lvalue routine gave incorrect results in some cases,
notably B appearing in X:=A.B.C; returned true, which is bogus.
This resulted in incorrect 'm' (modified) entries in the xref.

The following is a test program:

package RefMod is
   type Project_Config is record
      F : Integer := 1;
   end record;

   type Project_Data is record
      Config : Project_Config;
   end record;

   procedure Foo;
end RefMod;

package body RefMod is
   procedure Foo is
      P : Project_Data;
      L : Integer;
   begin
      L := P.Config.F;  --  line 6
      P.Config.F := L;  --  line 7
   end Foo;
end RefMod;

If we grep the ali, using grep "*Config" refmod.ali, the output
is a single line:

7r7*Config{2R9} 2|6r14 7m9

Before the patch, this gave 6m14 instead of 6r14

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

2009-04-29  Robert Dewar  <dewar@adacore.com>

	* sem_util.adb (May_Be_Lvalue): Fix cases involving indexed/selected
	components


Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]