aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2004-09-24 15:23:06 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2004-09-24 15:23:06 +0000
commit43c2a69adf87b340b098de12592efc647e0a88b1 (patch)
tree49f2db05a19f99575128e722445de4ec1e6b08d3
parent55e74277eac73f4a1b8cd6d7dbe3df36b6984436 (diff)
downloadgcc-43c2a69adf87b340b098de12592efc647e0a88b1.zip
gcc-43c2a69adf87b340b098de12592efc647e0a88b1.tar.gz
gcc-43c2a69adf87b340b098de12592efc647e0a88b1.tar.bz2
parser.c (cp_parser_expression_stack): Clarify why it is an array of NUM_PREC_VALUES elements.
2004-09-24 Paolo Bonzini <bonzini@gnu.org> * parser.c (cp_parser_expression_stack): Clarify why it is an array of NUM_PREC_VALUES elements. (cp_parser_binary_expression): Clarify why we do not need to handle stack overflow. From-SVN: r88042
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parser.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 80c2b79..dee8d5a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * parser.c (cp_parser_expression_stack): Clarify why it is
+ an array of NUM_PREC_VALUES elements.
+ (cp_parser_binary_expression): Clarify why we do not need to
+ handle stack overflow.
+
2004-09-24 Nathan Sidwell <nathan@codesourcery.com>
PR c++/16889
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 49d0237..89a9601 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -1106,6 +1106,9 @@ typedef struct cp_parser_expression_stack_entry
int prec;
} cp_parser_expression_stack_entry;
+/* The stack for storing partial expressions. We only need NUM_PREC_VALUES
+ entries because precedence levels on the stack are monotonically
+ increasing. */
typedef struct cp_parser_expression_stack_entry
cp_parser_expression_stack[NUM_PREC_VALUES];
@@ -5356,7 +5359,9 @@ cp_parser_binary_expression (cp_parser* parser)
if (lookahead_prec > new_prec)
{
/* ... and prepare to parse the RHS of the new, higher priority
- expression. */
+ expression. Since precedence levels on the stack are
+ monotonically increasing, we do not have to care about
+ stack overflows. */
sp->prec = prec;
sp->tree_type = tree_type;
sp->lhs = lhs;