This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21879] Memory management problem in new C parser
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jun 2005 17:39:27 -0000
- Subject: [Bug c/21879] Memory management problem in new C parser
- References: <20050602134308.21879.ebotcazou@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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