New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of nodes contains only 1 element #148

Closed
jean1 opened this Issue Aug 18, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@jean1
Collaborator

jean1 commented Aug 18, 2015

Probably a regression from commit d725f58 ;
The following thing is happening in node.c:create_node:

MOBJ_ALLOC_INSERT (n, nodemobj) ;
memset (n, 0, sizeof *n) ;

The memset destroy link to next element, since ALLOC_INSERT
already creates the link to next:

define MOBJ_ALLOC_INSERT(v,m) (((v) = mobj_alloc ((m),1)), \

                             ((v)->next = mobj_head (m)), \
                             (mobj_sethead ((m), (v))) )
@jean1

This comment has been minimized.

Show comment
Hide comment
@jean1

jean1 Aug 18, 2015

Collaborator

No wonder it is destroyed (result obtained on gcc):
sizeof n=8
sizeof *n=632
So sizeof *value is the size of the structure. Makes sense. The correct way would
be sizeof (struct node *)
But the best way would be probably to remove this memset.

Collaborator

jean1 commented Aug 18, 2015

No wonder it is destroyed (result obtained on gcc):
sizeof n=8
sizeof *n=632
So sizeof *value is the size of the structure. Makes sense. The correct way would
be sizeof (struct node *)
But the best way would be probably to remove this memset.

jean1 added a commit that referenced this issue Aug 18, 2015

@jean1

This comment has been minimized.

Show comment
Hide comment
@jean1

jean1 Aug 18, 2015

Collaborator

closed by 3b37350

Collaborator

jean1 commented Aug 18, 2015

closed by 3b37350

@jean1 jean1 closed this Aug 18, 2015

@jean1 jean1 added the bug label Aug 26, 2015

@jean1 jean1 added this to the v2.3.1 milestone Aug 26, 2015

@jean1 jean1 self-assigned this Aug 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment