[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI; Both: Fix nullable again
From: |
Akim Demaille |
Subject: |
FYI; Both: Fix nullable again |
Date: |
15 Dec 2001 17:16:00 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service) |
I think this bug was in the original Bison.
Index: ChangeLog
from Akim Demaille <address@hidden>
* src/nullable.c (set_nullable): Useless rules must be skipped,
otherwise, since we range over their symbols, we might look at a
nonterminal which no longer ``exists'', i.e., it is not counted in
`nvars', hence we overflow our arrays.
Index: src/nullable.c
===================================================================
RCS file: /cvsroot/bison/bison/src/nullable.c,v
retrieving revision 1.20
diff -u -u -w -u -r1.20 nullable.c
--- src/nullable.c 13 Dec 2001 11:02:20 -0000 1.20
+++ src/nullable.c 15 Dec 2001 16:21:16 -0000
@@ -69,6 +69,8 @@
p = relts;
for (ruleno = 1; ruleno < nrules + 1; ++ruleno)
+ if (rule_table[ruleno].useful)
+ {
if (ritem[rule_table[ruleno].rhs] > 0)
{
/* This rule has a non empty RHS. */
@@ -98,6 +100,7 @@
{
nullable[rule_table[ruleno].lhs] = 1;
*s2++ = rule_table[ruleno].lhs;
+ }
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI; Both: Fix nullable again,
Akim Demaille <=