]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR java/13824 (gcj SEGV with simple .java program)
authorRoger Sayle <roger@eyesopen.com>
Thu, 29 Jan 2004 18:58:13 +0000 (18:58 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 29 Jan 2004 18:58:13 +0000 (18:58 +0000)
PR java/13824
* tree.c (unsafe_for_reeval): Handle EXIT_BLOCK_EXPR nodes specially
as their EXIT_BLOCK_LABELED_BLOCK operands can lead to unbounded
recursion.

From-SVN: r76889

gcc/ChangeLog
gcc/tree.c

index af1346fab574ead12dbbfd8cd68e160422f74182..883fe8fb7d80a5ff6af25bd919ad4edbf966e591 100644 (file)
@@ -1,3 +1,10 @@
+2004-01-29  Roger Sayle  <roger@eyesopen.com>
+
+       PR java/13824
+       * tree.c (unsafe_for_reeval): Handle EXIT_BLOCK_EXPR nodes specially
+       as their EXIT_BLOCK_LABELED_BLOCK operands can lead to unbounded
+       recursion.
+
 2004-01-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        * doc/invoke.texi: Remove the pni option from -mfpmath=.
index cae9bc6852d32fd3c818caf420e0303bb3995f29..415d0824a36bf27536c277d60029142801e79270 100644 (file)
@@ -1686,6 +1686,13 @@ unsafe_for_reeval (expr)
       unsafeness = 1;
       break;
 
+    case EXIT_BLOCK_EXPR:
+      /* EXIT_BLOCK_LABELED_BLOCK, a.k.a. TREE_OPERAND (expr, 0), holds
+        a reference to an ancestor LABELED_BLOCK, so we need to avoid
+        unbounded recursion in the 'e' traversal code below.  */
+      exp = EXIT_BLOCK_RETURN (expr);
+      return exp ? unsafe_for_reeval (exp) : 0;
+
     default:
       tmp = (*lang_hooks.unsafe_for_reeval) (expr);
       if (tmp >= 0)