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 protection issue in reduce-common-type counters #1553

Merged
merged 4 commits into from
Apr 13, 2022
Merged

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Apr 12, 2022

Closes tidyverse/tidyr#1348.

I've tried to simplify the memory management a bit, but if we keep having issues in this area of the code, we should probably rewrite it in a simpler way.

Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This definitely makes it easier for me to follow. Agreed that it is overall still a little complicated, but it seems fine to merge!

// finished. We protect those from upstack.
r_list_poke(shelter, COUNTERS_SHELTER_names, names);

struct counters_data* p_data = r_raw_begin(data_shelter);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not get warnings about not being able to do this cast? Normally I have to this to avoid warnings:

struct counters_data* p_data = (struct counters_data*) r_raw_begin(data_shelter);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I don't get any warnings with gcc or clang. I was under the impression that we can assign from void* to anything, e.g. with malloc()'s return pointer.

NEWS.md Outdated Show resolved Hide resolved
@lionel- lionel- merged commit 28b8959 into main Apr 13, 2022
@lionel- lionel- deleted the protection-counters branch April 13, 2022 08:16
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.

R crashes when using tidyr::unnest_wider
2 participants