diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-13 17:28:26 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-13 17:28:26 +0000 |
commit | 5a6ca2d1ad2c2ae963730c6417bccc3852167ed4 (patch) | |
tree | 47829a64c961bcc1f71eab99a309a353024daf47 /gcc/langhooks.c | |
parent | 28485874fd07fd3226d22b7006f00545006c1597 (diff) | |
download | gcc-5a6ca2d1ad2c2ae963730c6417bccc3852167ed4.tar.gz |
2008-07-13 Richard Guenther <rguenther@suse.de>
PR middle-end/36811
* langhooks.c (lhd_print_error_function): Deal with recursive
BLOCK trees.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137754 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/langhooks.c')
-rw-r--r-- | gcc/langhooks.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 3943f02b794..e2460473f54 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -394,7 +394,9 @@ lhd_print_error_function (diagnostic_context *context, const char *file, if (abstract_origin) { ao = BLOCK_ABSTRACT_ORIGIN (abstract_origin); - while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao)) + while (TREE_CODE (ao) == BLOCK + && BLOCK_ABSTRACT_ORIGIN (ao) + && BLOCK_ABSTRACT_ORIGIN (ao) != ao) ao = BLOCK_ABSTRACT_ORIGIN (ao); gcc_assert (TREE_CODE (ao) == FUNCTION_DECL); fndecl = ao; @@ -424,7 +426,9 @@ lhd_print_error_function (diagnostic_context *context, const char *file, { ao = BLOCK_ABSTRACT_ORIGIN (block); - while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao)) + while (TREE_CODE (ao) == BLOCK + && BLOCK_ABSTRACT_ORIGIN (ao) + && BLOCK_ABSTRACT_ORIGIN (ao) != ao) ao = BLOCK_ABSTRACT_ORIGIN (ao); if (TREE_CODE (ao) == FUNCTION_DECL) |