summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-08 09:12:43 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-08 09:12:43 +0000
commit7a4047d65ad86e53104c5b47bc3493c0a3d7267d (patch)
tree3fe9d9e257838ae13fde6d84e73781fd901353eb /gcc/ada/gcc-interface/utils.c
parent2c6a9bedba6d8b1860bb37c757547d8920742917 (diff)
* gcc-interface/utils.c (begin_subprog_body): Assert that the body is
present in the same context as the declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220510 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 369f65c2bf58..44dad7b1ecf9 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -3105,6 +3105,11 @@ begin_subprog_body (tree subprog_decl)
/* This function is being defined. */
TREE_STATIC (subprog_decl) = 1;
+ /* The failure of this assertion will likely come from a wrong context for
+ the subprogram body, e.g. another procedure for a procedure declared at
+ library level. */
+ gcc_assert (current_function_decl == decl_function_context (subprog_decl));
+
current_function_decl = subprog_decl;
/* Enter a new binding level and show that all the parameters belong to