diff options
author | Bernd Schmidt <bernds@redhat.com> | 2016-02-12 01:38:06 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2016-02-12 01:38:06 +0000 |
commit | 16595a1f286b9f421000a25866f465bd45a24538 (patch) | |
tree | 91eedf26ad1b6621eed02ddc3ccecc0614c40a1a /gcc/c/c-tree.h | |
parent | 38d795d27c34ebc70a944009d82d20415ec81a64 (diff) | |
download | gcc-16595a1f286b9f421000a25866f465bd45a24538.zip gcc-16595a1f286b9f421000a25866f465bd45a24538.tar.gz gcc-16595a1f286b9f421000a25866f465bd45a24538.tar.bz2 |
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.
From-SVN: r233366
Diffstat (limited to 'gcc/c/c-tree.h')
-rw-r--r-- | gcc/c/c-tree.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h index cf79ba7..96ab049 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 *); |