Skip to content
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

a bug in m-array _insert_v() method? #41

Closed
mario-tux opened this issue Dec 5, 2018 · 1 comment
Closed

a bug in m-array _insert_v() method? #41

mario-tux opened this issue Dec 5, 2018 · 1 comment
Assignees
Labels

Comments

@mario-tux
Copy link

I'm facing something that looks a bug. I need to make space inside an array-based list , so I'm using _insert_v method to create some new initialized entries. As I understand from the documentation and from a quick view on the code: it should manage the case when the reserved/allocated space in the list is insufficient to support the insertion.

Something like this works:

my_list_resize(list, 201);
my_list_reserve(list, 512);
my_list_insert_v(list, 200, 300);

Instead this doesn't:

my_list_resize(list, 201);
my_list_reserve(list, 512);
my_list_insert_v(list, 200, 600);

Is it a bug?

In my original code I'm facing assertion violations on the contract clause: v->size <= v->alloc.

@P-p-H-d P-p-H-d self-assigned this Dec 5, 2018
@P-p-H-d P-p-H-d added the bug label Dec 5, 2018
@P-p-H-d
Copy link
Owner

P-p-H-d commented Dec 5, 2018

I reproduced the issue. It was due to an overflow.
It should be fixed in master.
Thanks for your report.

@P-p-H-d P-p-H-d closed this as completed Dec 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants