cex: more consistent memory allocation/copy

* src/counterexample.c, src/parse-simulation.c: It is more usual in
Bison to use sizeof on expressions than on types, especially for
allocation.
Let the compiler do it's job instead of calling memcpy ourselves.
This commit is contained in:
Akim Demaille
2020-07-12 14:46:45 +02:00
parent 5bad15d7ea
commit d7f27477f4
2 changed files with 9 additions and 9 deletions

View File

@@ -135,7 +135,7 @@ static parse_state *
copy_parse_state (bool prepend, parse_state *parent)
{
parse_state *res = xmalloc (sizeof *res);
memcpy (res, parent, sizeof *res);
*res = *parent;
res->state_items.contents
= gl_list_create_empty (GL_LINKED_LIST, NULL, NULL, NULL, true);
res->derivs.contents = derivation_list_new ();