mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 21:33:04 +00:00
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:
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user