]> git.saurik.com Git - bison.git/blobdiff - src/ielr.c
named references: fix double free.
[bison.git] / src / ielr.c
index 657c3a1d942bad08e8c77c33a6d6a1393b15b4a9..2bf9412b963fac2cf18300dbd3a1f27ad4a08c4b 100644 (file)
@@ -1,6 +1,6 @@
 /* IELR main implementation.
 
 /* IELR main implementation.
 
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -29,7 +29,7 @@
 #include "derives.h"
 #include "getargs.h"
 #include "lalr.h"
 #include "derives.h"
 #include "getargs.h"
 #include "lalr.h"
-#include "muscle_tab.h"
+#include "muscle-tab.h"
 #include "nullable.h"
 #include "relation.h"
 #include "state.h"
 #include "nullable.h"
 #include "relation.h"
 #include "state.h"
@@ -504,15 +504,15 @@ ielr_compute_annotation_lists (bitsetv follow_kernel_items,
       (*annotation_listsp)[i] = NULL;
       annotation_counts[i] = 0;
     }
       (*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)
     {
   *max_annotationsp = 0;
   for (i = 0; i < nstates; ++i)
     {