diff options
author | Richard Henderson <rth@redhat.com> | 2001-12-23 17:47:10 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-12-23 17:47:10 -0800 |
commit | 72ac12bf6f0bbb3a61e74412fadb287cf9c3ced6 (patch) | |
tree | b37a87a99944963c71884b215fa3a08b68ee91de /gcc/ada/utils.c | |
parent | b6e220169cd0b67067e1c4929eb08b964191aa1b (diff) | |
download | gcc-72ac12bf6f0bbb3a61e74412fadb287cf9c3ced6.zip gcc-72ac12bf6f0bbb3a61e74412fadb287cf9c3ced6.tar.gz gcc-72ac12bf6f0bbb3a61e74412fadb287cf9c3ced6.tar.bz2 |
utils.c (end_subprog_body): Push GC context around rest_of_compilation for nested functions.
* utils.c (end_subprog_body): Push GC context around
rest_of_compilation for nested functions.
From-SVN: r48294
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r-- | gcc/ada/utils.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 8f1f341..ead4d02 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * * * Copyright (C) 1992-2001, Free Software Foundation, Inc. * * * @@ -1844,8 +1844,18 @@ end_subprog_body () DECL_CONTEXT (DECL_RESULT (current_function_decl)) = current_function_decl; expand_function_end (input_filename, lineno, 0); + + /* If this is a nested function, push a new GC context. That will keep + local variables on the stack from being collected while we're doing + the compilation of this function. */ + if (function_nesting_depth > 1) + ggc_push_context (); + rest_of_compilation (current_function_decl); + if (function_nesting_depth > 1) + ggc_pop_context (); + #if 0 /* If we're sure this function is defined in this file then mark it as such */ |