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

Re: C++ PATCH: obstack leakage -> segfault


>>>>> "Nathan" == Nathan Sidwell <nathan@acm.org> writes:

    Nathan> I attach a patch to complete_array_type (decl.c) which
    Nathan> makes sure the domain is placed in the permanent obstack,
    Nathan> if anything it's being attached to is.  (Perhaps it should
    Nathan> always be placed on the permanent obstack?)

Contrary to what Jason just said, I don't like this patch. :-)

I'd prefer calling `push_obstacks (TYPE_OBSTACK (type))' and
`pop_obstacks ()' around the call to build_index_type.  That would
save the copy, and preserves the invariant you *really* want: all
pieces of a type ought to live on the same obstack.

Does that not work?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


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