[PATCH] Fix PR preprocessor/6489 (take 3)

Jakub Jelinek jakub@redhat.com
Thu May 2 23:58:00 GMT 2002


On Thu, May 02, 2002 at 03:57:26PM -0700, Mark Mitchell wrote:
> > Mark, ok for branch?
> 
> Your algorithm is a bit cleverer than I'd prefer. :-)  But, after staring
> at, I've convince myself it's correct, assuming that fp->length being
> shorter than it was originally doesn't confuse anything.  (For example,
> this assumes that nothing is explicitly checking that length when the
> memory is freed.)

I think it is safe, because all 4 code hunks which read files
into the buffers and set fp->length allow fp->length to be smaller than
actual allocated buffer length (when reading from regular files, because
of VMS st_size is an upper bound, when reading from devices, buffer size
is 2^N*2000+2 and fp->length whatever number of bytes were actually read from
the device.

	Jakub



More information about the Gcc-patches mailing list