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 VAX crash


Jason R Thorpe wrote:
Richard...

In reference to:

	http://gcc.gnu.org/ml/gcc-bugs/2002-11/msg00244.html

...your REAL_TO_DECIMAL -> real_to_decimal change seems to be
the culprit.  The attached patch prevents the compiler from crashing,
although it's not clear to me why real_to_decimal isn't obeying
the passed-in buffer size..?

Taking a quick peek at the real_to_decimal routine I see a fair number of
places where it adds to the buffer without checking if there's any room left.


It's probably easier and simpler for the routine to use an internal
buffer that's always big enough to accumulate the result and then at
the end copy it to the output buffer truncating if necessary.

Graham


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