mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
* 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.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2001-12-15 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2001-12-15 Akim Demaille <akim@epita.fr>
|
2001-12-15 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/reader.c (copy_action): When --yacc, don't append a `;'
|
* src/reader.c (copy_action): When --yacc, don't append a `;'
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ set_nullable (void)
|
|||||||
p = relts;
|
p = relts;
|
||||||
|
|
||||||
for (ruleno = 1; ruleno < nrules + 1; ++ruleno)
|
for (ruleno = 1; ruleno < nrules + 1; ++ruleno)
|
||||||
|
if (rule_table[ruleno].useful)
|
||||||
|
{
|
||||||
if (ritem[rule_table[ruleno].rhs] > 0)
|
if (ritem[rule_table[ruleno].rhs] > 0)
|
||||||
{
|
{
|
||||||
/* This rule has a non empty RHS. */
|
/* This rule has a non empty RHS. */
|
||||||
@@ -100,6 +102,7 @@ set_nullable (void)
|
|||||||
*s2++ = rule_table[ruleno].lhs;
|
*s2++ = rule_table[ruleno].lhs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (s1 < s2)
|
while (s1 < s2)
|
||||||
for (p = rsets[*s1++]; p; p = p->next)
|
for (p = rsets[*s1++]; p; p = p->next)
|
||||||
|
|||||||
Reference in New Issue
Block a user