public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wilson at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/24202] [3.4/4.0/4.1 Regression] Segfault with #pragma once
Date: Tue, 01 Nov 2005 07:19:00 -0000	[thread overview]
Message-ID: <20051101071927.11706.qmail@sourceware.org> (raw)
In-Reply-To: <bug-24202-5724@http.gcc.gnu.org/bugzilla/>



------- Comment #10 from wilson at gcc dot gnu dot org  2005-11-01 07:19 -------
On mainline, this appears to be fixable with a one line patch.

We are failing in should_stack_file because we have a _cpp_file struct with
buffer=0 and buffer_valid=1.  We call read_file which immediately returns
because buffer_valid is true.  Then we try to read chars from the buffer and
crash because it is still zero.

The trivial fix is that we must clear buffer_valid when we clear buffer.  This
is done in _cpp_pop_file_buffer.  The testcase works with this patch.

I haven't looked at any of the patch history or at the older gcc versions yet.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24202


  parent reply	other threads:[~2005-11-01  7:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-04 21:59 [Bug preprocessor/24202] New: " debian-gcc at lists dot debian dot org
2005-10-04 21:59 ` [Bug preprocessor/24202] " debian-gcc at lists dot debian dot org
2005-10-04 23:05 ` [Bug preprocessor/24202] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-10-06 22:21 ` janis187 at us dot ibm dot com
2005-10-07 19:45 ` janis187 at us dot ibm dot com
2005-10-07 19:50 ` [Bug preprocessor/24202] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-10-08 13:37 ` pinskia at gcc dot gnu dot org
2005-10-08 22:10 ` janis at gcc dot gnu dot org
2005-10-08 22:11 ` janis at gcc dot gnu dot org
2005-10-31  6:02 ` [Bug preprocessor/24202] [3.4/4.0/4.1 " mmitchel at gcc dot gnu dot org
2005-11-01  7:19 ` wilson at gcc dot gnu dot org [this message]
2005-11-01  7:22 ` wilson at gcc dot gnu dot org
2005-11-01  7:25 ` wilson at gcc dot gnu dot org
2005-11-01 23:51 ` wilson at gcc dot gnu dot org
2005-11-04  2:10 ` wilson at gcc dot gnu dot org
2005-11-04  2:13 ` wilson at gcc dot gnu dot org
2005-11-04  4:42 ` [Bug preprocessor/24202] [3.4 " pinskia at gcc dot gnu dot org
2006-03-01 10:11 ` gdr at gcc dot gnu dot org
2006-03-01 10:11 ` gdr at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051101071927.11706.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).