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]

Re: ada/4851: GNAT crashs on certain argument lines


Hi Florian,

You wrote:
> The old comment suggests that Generic_Position once was a procedure.
> I wonder who changed it and why. ;-) (The bug is present in the GNAT
> 3.13p sources as well, but it might not show up because of code
> generation differences.)
This code was introduced in 1999 and always had the bug you mention,
and always was a function rather than a procedure.

> 2001-11-11  Florian Weimer  <fw@deneb.enyo.de>
>
> 	* make.adb (Add_Switch): Make Generic_Position a procedure.
> 	The function approach did not work well because of a side
> 	effect (the function call could reallocate the table which was
> 	being indexed using its result).

Your patch is OK. I have regression-tested it against the ACT test-suite
and it passes fine, as expected. I'd only suggest a one-word comment 
improvement:

<       --  Generic procedure that chooses a position for S in T at the
--
 >       --  Generic procedure that allocates a position for S in T at the

This better describes what the procedure does.

Regards,
   -Geert


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