This is the mail archive of the
mailing list for the GCC project.
Re: ada/4851: GNAT crashs on certain argument lines
- From: Geert Bosch <bosch at gnat dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Dec 2001 14:18:06 -0500
- Subject: Re: ada/4851: GNAT crashs on certain argument lines
> 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 <firstname.lastname@example.org>
> * 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
< -- 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.