mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 02:03:03 +00:00
(goto_map, ngotos, from_state, to_state): Omit
initial values, since they're never used. (set_goto_map): ngotos is now unsigned, so test for overflow
This commit is contained in:
12
src/lalr.c
12
src/lalr.c
@@ -42,10 +42,10 @@
|
|||||||
#include "relation.h"
|
#include "relation.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
|
|
||||||
goto_number *goto_map = NULL;
|
goto_number *goto_map;
|
||||||
static goto_number ngotos = 0;
|
static goto_number ngotos;
|
||||||
state_number *from_state = NULL;
|
state_number *from_state;
|
||||||
state_number *to_state = NULL;
|
state_number *to_state;
|
||||||
|
|
||||||
/* Linked list of goto numbers. */
|
/* Linked list of goto numbers. */
|
||||||
typedef struct goto_list
|
typedef struct goto_list
|
||||||
@@ -90,9 +90,9 @@ set_goto_map (void)
|
|||||||
int i;
|
int i;
|
||||||
for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i)
|
for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i)
|
||||||
{
|
{
|
||||||
if (ngotos >= GOTO_NUMBER_MAXIMUM)
|
|
||||||
abort ();
|
|
||||||
ngotos++;
|
ngotos++;
|
||||||
|
if (! ngotos)
|
||||||
|
abort ();
|
||||||
goto_map[TRANSITION_SYMBOL (sp, i) - ntokens]++;
|
goto_map[TRANSITION_SYMBOL (sp, i) - ntokens]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user