This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Potential GC problem in preprocessed C++


Alexandre Oliva wrote:-

> I'm well aware the way we handle filenames and strings has changed a
> lot since back then.

Well, for the C family front ends, the input_filename /
main_input_filename stuff all points to memory ownded by cpplib, and
cpplib explicitly guarantees such memory will not disappear until you
destroy your reader object, i.e. until cc1 itself exits.  So this
problem probably vanished with the tighter merging of cpplib to the
front ends that has been going on over the past year.

I'm of the opinion that the input_filename stuff is all a hack anyway,
with random code changing them, along with lineno, for its own local
reasons.  lineno, input_filename and the current file stack should be
removed, and replaced with something that uses something like
line_map.{c,h} for all front ends.  It does the job they're trying to
do, and does it better since you only need a lineno to describe a file
+ line location.

Neil.


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