This is the mail archive of the
mailing list for the GCC project.
[Bug preprocessor/24202] [3.4/4.0/4.1 Regression] Segfault with #pragma once
- From: "wilson at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2005 23:51:47 -0000
- Subject: [Bug preprocessor/24202] [3.4/4.0/4.1 Regression] Segfault with #pragma once
- References: <firstname.lastname@example.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from wilson at gcc dot gnu dot org 2005-11-01 23:51 -------
I believe the problem originated here:
2003-07-29 Neil Booth <email@example.com>
* Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.
* cppfiles.c: Completely rewritten.
This added the buffer_valid field, and added code that clears buffer without
also clearing buffer_valid. This is revision 1.178 in the gcc/cppfiles.c file.
The failure occurs only when we free a valid buffer, and then try to reuse that
buffer because we still think it is valid. Whether this occurs depends on how
buffers are managed by cpp, and how they are used by cpp, so I don't find it
surprising that this latent bug has been disappearing and reappearing over
time. The patch identified by Janis just makes the problem more visible
because it adds more uses of buffer_valid.
Now I'm off to test my patch. The same patch should work for all 3 gcc