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

Fix Bitset's core dump when copying from an empty Bitset #156

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

songqing
Copy link
Contributor

What do these changes do?

The Bitset can be constructed with size == 0, and when another Bitset copies from the empty Bitset, there will be core dump as the memcpy()

f1

@sighingnow
Copy link
Collaborator

In both copy assignment and move assignment, I think you need to free/deallocate the existing data buffer (if not NULL) first before assigning?

@songqing
Copy link
Contributor Author

In both copy assignment and move assignment, I think you need to free/deallocate the existing data buffer (if not NULL) first before assigning?
Yes, you are right. Done

@codecov-commenter
Copy link

Codecov Report

Merging #156 (d7e11ba) into master (515da59) will increase coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #156      +/-   ##
==========================================
+ Coverage   63.94%   63.96%   +0.01%     
==========================================
  Files          67       67              
  Lines        6310     6310              
==========================================
+ Hits         4035     4036       +1     
+ Misses       2275     2274       -1     
Flag Coverage Δ
app_tests 63.96% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
grape/utils/bitset.h 75.00% <ø> (ø)

... and 1 file with indirect coverage changes

@sighingnow sighingnow merged commit fab111a into alibaba:master Sep 12, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants