aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-05-20 07:00:47 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-05-20 07:00:47 -0400
commit8ae49a28b3904b0e9e4fe326a335c8b591a2401e (patch)
treec101ec471683b19748a0bb2e349baab31032bc6d /gcc
parentf32da1f64c316511355f43ef1c3526d939ba0d0b (diff)
downloadgcc-8ae49a28b3904b0e9e4fe326a335c8b591a2401e.zip
gcc-8ae49a28b3904b0e9e4fe326a335c8b591a2401e.tar.gz
gcc-8ae49a28b3904b0e9e4fe326a335c8b591a2401e.tar.bz2
(simple_cst_equal): Don't look at language-specific nodes since we
don't know what's in them. From-SVN: r9754
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index f97a95e..0388e8b 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3564,8 +3564,13 @@ simple_cst_equal (t1, t2)
return 0;
}
- /* This general rule works for most tree codes.
- All exceptions should be handled above. */
+ /* This general rule works for most tree codes. All exceptions should be
+ handled above. If this is a language-specific tree code, we can't
+ trust what might be in the operand, so say we don't know
+ the situation. */
+ if (code1
+ >= sizeof standard_tree_code_type / sizeof standard_tree_code_type[0])
+ return -1;
switch (TREE_CODE_CLASS (code1))
{