aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-tree.h
diff options
context:
space:
mode:
authorBernd Schmidt <bschmidt@redhat.com>2016-02-12 01:38:06 +0000
committerBernd Schmidt <bschmidt@redhat.com>2016-02-12 01:38:06 +0000
commit396c9380d1876b8a73472ac7a23210727b9f7567 (patch)
tree91eedf26ad1b6621eed02ddc3ccecc0614c40a1a /gcc/c/c-tree.h
parent4dbc7690430b17a705a01bca0845521264d417b2 (diff)
Fix obstack use-after-free problems in C frontend, PR69522
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@233366 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c/c-tree.h')
-rw-r--r--gcc/c/c-tree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index cf79ba71b15..96ab049b982 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -625,6 +625,7 @@ extern void maybe_warn_string_init (location_t, tree, struct c_expr);
extern void start_init (tree, tree, int);
extern void finish_init (void);
extern void really_start_incremental_init (tree);
+extern void finish_implicit_inits (location_t, struct obstack *);
extern void push_init_level (location_t, int, struct obstack *);
extern struct c_expr pop_init_level (location_t, int, struct obstack *);
extern void set_init_index (location_t, tree, tree, struct obstack *);