https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69522
--- Comment #12 from Bernd Schmidt <bernds at gcc dot gnu.org> --- Author: bernds Date: Wed Feb 17 13:13:08 2016 New Revision: 233493 URL: https://gcc.gnu.org/viewcvs?rev=233493&root=gcc&view=rev Log: Backport PR69522 use-after-free fix. c/ PR c/69522 * c-parser.c (c_parser_braced_init): New arg outer_obstack. All callers changed. If nested_p is true, use it to call finish_implicit_inits. * c-tree.h (finish_implicit_inits): Declare. * c-typeck.c (finish_implicit_inits): New function. Move code from ... (push_init_level): ... here. (set_designator, process_init_element): Call finish_implicit_inits. testsuite/ PR c/69522 gcc.dg/pr69522.c: New test. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr69522.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/c/c-parser.c branches/gcc-4_9-branch/gcc/c/c-tree.h branches/gcc-4_9-branch/gcc/c/c-typeck.c branches/gcc-4_9-branch/gcc/testsuite/ChangeLog