From: Eric Botcazou Date: Sun, 8 Feb 2015 09:12:43 +0000 (+0000) Subject: utils.c (begin_subprog_body): Assert that the body is present in the same context... X-Git-Tag: releases/gcc-5.1.0~1088 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2d13a4ad1876a15a4d77915d2138b0122afe411;p=thirdparty%2Fgcc.git utils.c (begin_subprog_body): Assert that the body is present in the same context as the declaration. * gcc-interface/utils.c (begin_subprog_body): Assert that the body is present in the same context as the declaration. From-SVN: r220510 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f34dd913bcca..ed638a61c5ed 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2015-02-08 Eric Botcazou + + * gcc-interface/utils.c (begin_subprog_body): Assert that the body is + present in the same context as the declaration. + 2015-02-07 Jakub Jelinek PR middle-end/64340 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