Fix some memory leaks, and fix a bug: state 0 was examined twice.
authorAkim Demaille <akim@epita.fr>
Wed, 3 Jul 2002 06:51:43 +0000 (06:51 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 3 Jul 2002 06:51:43 +0000 (06:51 +0000)
commit8b752b00fdaaa3802e4ab05a468f6cda4a9fa500
tree843b74b9a7fb408737192cc57cd19bd68a781a55
parent613f5e1a895b0742c9b6c5e9461e4cf3f7389d7e
Fix some memory leaks, and fix a bug: state 0 was examined twice.
* src/LR0.c (new_state): Merge into...
(state_list_append): this.
(new_states): Merge into...
(generate_states): here.
(set_states): Don't ensure a proper `errs' state member here, do it...
* src/conflicts.c (conflicts_solve): here.
* src/state.h, src/state.c: Comment changes.
(state_t): Rename member `shifts' as `transitions'.
Adjust all dependencies.
(errs_new): For consistency, also take the values as argument.
(errs_dup): Remove.
(state_errs_set): New.
(state_reductions_set, state_transitions_set): Assert that no
previous value was assigned.
(state_free): New.
(states_free): Use it.
* src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
temporary storage: use `errs' and `nerrs' as elsewhere.
(set_conflicts): Allocate and free this `errs'.
ChangeLog
src/LR0.c
src/conflicts.c
src/lalr.c
src/output.c
src/print.c
src/print_graph.c
src/state.c
src/state.h