This is the mail archive of the gcc-bugs@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]

[Bug c/21879] Memory management problem in new C parser


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-06-02 17:39 -------
> I don't see anything intrinsically to do with the parser in this bug; when 
> a function finishes, label_context_stack_se and label_context_stack_vm 
> should end up as NULL so this memory should not be live.

Do you mean that parser_obstack is effectively a per-toplevel-decl object and
that it is supposed to be dead at the end of the object's parsing, although in
the present case there are objects associated with different toplevel decls
allocated on it that point to each other?  And I presume label_context_stack_vm
is not explicitly reset to NULL on function exit because of nested functions?

Maybe a few sanity checks can be added to c_parser_translation_unit so as make
implicit assumptions like these more explicit.

-- 


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


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