This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] cpp segfault fix
- To: Zack Weinberg <zack at wolery dot cumb dot org>
- Subject: Re: [PATCH] cpp segfault fix
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 1 Aug 2000 11:51:23 +0200
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20000731124205.B26939@sunsite.ms.mff.cuni.cz> <20000731162506.D4155@wolery.cumb.org>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
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