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]

Re: [PATCH] cpp segfault fix


On Mon, Jul 31, 2000 at 04:25:06PM -0700, Zack Weinberg wrote:
> On Mon, Jul 31, 2000 at 12:42:05PM +0200, Jakub Jelinek wrote:
> > Hi!
> > 
> > cpp segfaults on 64bit arches when given a directory as argument instead of
> > exiting with
> > <command line>: /tmp is a directory
> > The issue is that in _cpp_get_line we get index 0 and try to read from
> > tokens[0xffffffff]. Even reading from tokens[-1] on 32bit arches does not seem
> > to be a good idea to me though.
> 
> Good catch. I'd rather write if (index == 0) in this context - I'll
> apply the patch with that change.
> 
> Is it possible to trigger this bug by writing "#include </tmp>" in a
> file, and if so, can you add a test case, please?

No, it needs to come up from the command line (because otherwise is index
non-zero), so the issue is how to tell the testsuite to pass /tmp to command
line instead of some filename.

	Jakub

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