[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/7] cex: dervation reference counting
From: |
Akim Demaille |
Subject: |
Re: [PATCH 1/7] cex: dervation reference counting |
Date: |
Fri, 22 May 2020 08:17:32 +0200 |
FTR, I'm installing this diff within this patch, because otherwise it doesn't
compile cleanly on my machine.
/Users/akim/src/gnu/bison/src/parse-simulation.c: In function 'parser_pop':
/Users/akim/src/gnu/bison/src/parse-simulation.c:335:27: error: cast between
incompatible function types from 'struct gl_list_node_impl * (*)(struct
gl_list_impl *, const void *)' to 'void (*)(struct gl_list_impl *, void *)'
[-Werror=cast-function-type]
335 | (chunk_append_fn)gl_list_add_last);
| ^
cc1: all warnings being treated as errors
diff --git a/src/parse-simulation.c b/src/parse-simulation.c
index 5648bd5a..2be02834 100644
--- a/src/parse-simulation.c
+++ b/src/parse-simulation.c
@@ -265,7 +265,15 @@ parse_state_completed_steps (const parse_state *ps, int
*shifts, int *production
*shifts = root_ps->state_items.total_size - count;
}
-typedef void (*chunk_append_fn) (gl_list_t, void *);
+typedef void (*chunk_append_fn) (gl_list_t, const void *);
+
+// A version of gl_list_add_last which has the chunk_append_fn
+// signature.
+void list_add_last (gl_list_t list, const void *elt)
+{
+ gl_list_add_last (list, elt);
+}
+
// takes an array of n gl_lists and flattens them into two list
// based off of the index split
static void
@@ -332,7 +340,7 @@ parser_pop (parse_state *ps, int deriv_index,
ret->derivs.contents, popped_derivs
};
list_flatten_and_split (chunks, ret_chunks, si_index, 2,
- (chunk_append_fn)gl_list_add_last);
+ list_add_last);
list_flatten_and_split (chunks + 2, ret_chunks + 2, deriv_index, 2,
(chunk_append_fn)derivation_list_append);
size_t s_size = gl_list_size (ret->state_items.contents);
- [PATCH 0/7] Fixing all cex leaks, Vincent Imbimbo, 2020/05/21
- [PATCH 1/7] cex: dervation reference counting, Vincent Imbimbo, 2020/05/21
- Re: [PATCH 1/7] cex: dervation reference counting,
Akim Demaille <=
- [PATCH 2/7] cex: fix parse state leaks, Vincent Imbimbo, 2020/05/21
- [PATCH 3/7] cex: fix lssi leaks, Vincent Imbimbo, 2020/05/21
- [PATCH 4/7] cex: fix counterexample leak, Vincent Imbimbo, 2020/05/21
- [PATCH 5/7] cex: fix miscellaneous leaks, Vincent Imbimbo, 2020/05/21
- [PATCH 6/7] cex: fix bad reference counting, Vincent Imbimbo, 2020/05/21
- [PATCH 7/7] cex: replace state-item data structures, Vincent Imbimbo, 2020/05/21
- Re: [PATCH 0/7] Fixing all cex leaks, Akim Demaille, 2020/05/22