diff options
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r-- | gcc/ada/utils.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index ead346f2775..c30494f2162 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -257,9 +257,9 @@ gnat_pushlevel () current_binding_level = newlevel; } -/* Exit a binding level. */ +/* Exit a binding level. Return the BLOCK node, if any. */ -void +tree gnat_poplevel () { struct ada_binding_level *level = current_binding_level; @@ -289,13 +289,14 @@ gnat_poplevel () parent block. Otherwise, add it to the list of its parent. */ if (TREE_CODE (BLOCK_SUPERCONTEXT (block)) == FUNCTION_DECL) ; - else if (BLOCK_VARS (block) == 0) + else if (BLOCK_VARS (block) == NULL_TREE) { BLOCK_SUBBLOCKS (level->chain->block) = chainon (BLOCK_SUBBLOCKS (block), BLOCK_SUBBLOCKS (level->chain->block)); TREE_CHAIN (block) = free_block_chain; free_block_chain = block; + block = NULL_TREE; } else { @@ -308,6 +309,7 @@ gnat_poplevel () current_binding_level = level->chain; level->chain = free_binding_level; free_binding_level = level; + return block; } /* Insert BLOCK at the end of the list of subblocks of the |