mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
portability: <' and >' are not always defined on addresses.
Specifically, don't sort objects by their memory addresses when
they're not allocated in the same array or other object. Though
I haven't found a test case where that fails on my platform, C
says the behavior is undefined.
* src/AnnotationList.c (AnnotationList__insertInto): Remove
FIXME. Use new id field of InadequacyList nodes rather than
their memory addresses when sorting.
(AnnotationList__compute_from_inadequacies): Add
inadequacy_list_node_count argument to pass to
InadequacyList__new_conflict.
* src/AnnotationList.h
(AnnotationList__compute_from_inadequacies): Update prototype
and documentation for new argument.
* src/InadequacyList.c (InadequacyList__new_conflict): Add
node_count argument and use it to assign a unique ID.
* src/InadequacyList.h (InadequacyListNodeCount): New typedef.
(InadequacyList): Add id field.
(InadequacyList__new_conflict): Update prototype and
documentation for new argument.
* src/ielr.c (ielr_compute_annotation_lists): Update
AnnotationList__compute_from_inadequacies invocation.
(cherry picked from commit 2728ac7ecd)
This commit is contained in:
18
src/ielr.c
18
src/ielr.c
@@ -504,15 +504,15 @@ ielr_compute_annotation_lists (bitsetv follow_kernel_items,
|
||||
(*annotation_listsp)[i] = NULL;
|
||||
annotation_counts[i] = 0;
|
||||
}
|
||||
for (i = 0; i < nstates; ++i)
|
||||
AnnotationList__compute_from_inadequacies (states[i], follow_kernel_items,
|
||||
always_follows, predecessors,
|
||||
item_lookahead_sets,
|
||||
*inadequacy_listsp,
|
||||
*annotation_listsp,
|
||||
annotation_counts,
|
||||
&max_contributions,
|
||||
annotations_obstackp);
|
||||
{
|
||||
InadequacyListNodeCount inadequacy_list_node_count = 0;
|
||||
for (i = 0; i < nstates; ++i)
|
||||
AnnotationList__compute_from_inadequacies (
|
||||
states[i], follow_kernel_items, always_follows, predecessors,
|
||||
item_lookahead_sets, *inadequacy_listsp, *annotation_listsp,
|
||||
annotation_counts, &max_contributions, annotations_obstackp,
|
||||
&inadequacy_list_node_count);
|
||||
}
|
||||
*max_annotationsp = 0;
|
||||
for (i = 0; i < nstates; ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user