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: [PATCH] Fix overflow of -b switch


Jie Zhang wrote:
process_command () scans command line twice. The first time it just
counts how many switches. Then the switches vector is created
according to the count. The second time it copies the text of each
switch and stores a pointer to the copy in the vector of switches.
Currently, the first scan does not count -b if its argument has no
dash. So the switches vector has no enough space for all switches and
is overflowed when the second scan tries to store the pointers.

	* gcc.c (process_command): Treat -b as normal switch if its argument
	has no dash.

Ok if regtest successful.



Bernd



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