From: Joseph Myers Date: Fri, 3 Jun 2005 22:25:13 +0000 (+0100) Subject: re PR c/21879 (Memory management problem) X-Git-Tag: misc/cutover-cvs2svn~2653 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4d1cfd444501f09fd1e049bf7f14bbefec9da0a;p=thirdparty%2Fgcc.git re PR c/21879 (Memory management problem) PR c/21879 * c-decl.c (start_function): Restore label_context_stack_se and label_context_stack_vm if returning with an error. From-SVN: r100557 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 372e308d4911..2449d13860a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-06-03 Joseph S. Myers + + PR c/21879 + * c-decl.c (start_function): Restore label_context_stack_se and + label_context_stack_vm if returning with an error. + 2005-06-03 Gabriel Dos Reis * configure.ac: Check declaration for asprintf, needed by diff --git a/gcc/c-decl.c b/gcc/c-decl.c index d36ceb563d2a..ec94f95420cb 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5802,7 +5802,11 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, /* If the declarator is not suitable for a function definition, cause a syntax error. */ if (decl1 == 0) - return 0; + { + label_context_stack_se = label_context_stack_se->next; + label_context_stack_vm = label_context_stack_vm->next; + return 0; + } decl_attributes (&decl1, attributes, 0);