aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-01-21 09:34:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-01-21 09:34:19 +0000
commit02dcf7badb93cc064051e6719746293987eeb662 (patch)
tree6f554d4813d2c8677f8ccb321f6fad2ad910ca4e /gcc/cp/error.c
parentb158b5c6aa0a3773622552c165ee88ebc31ab004 (diff)
downloadgcc-02dcf7badb93cc064051e6719746293987eeb662.zip
gcc-02dcf7badb93cc064051e6719746293987eeb662.tar.gz
gcc-02dcf7badb93cc064051e6719746293987eeb662.tar.bz2
re PR c++/34850 (Recursive BLOCK tree causes compilation to hang during diagnostics)
2008-01-21 Richard Guenther <rguenther@suse.de> PR c++/34850 cp/ * error.c (cp_print_error_function): Deal with recursive BLOCK trees. * g++.dg/torture/pr34850.C: New testcase. From-SVN: r131690
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 41a83bf..94f108e 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2424,7 +2424,9 @@ cp_print_error_function (diagnostic_context *context,
{
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)