Skip to content

Make preserve list more robust to bad values #122

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

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

jimhester
Copy link
Member

XPtrs are marked as null when restoring, so we need to check for this
and we also now check that the option is a pairlist before trying to
read its value

Fixes #121

XPtrs are marked as null when restoring, so we need to check for this
and we also now check that the option is a pairlist before trying to
read its value

Fixes #121
@jimhester jimhester requested a review from kevinushey October 28, 2020 19:22
@jimhester
Copy link
Member Author

This refactors the preserve list code to be more robust to bad values. We now verify the types are what we expect, including when using the list_ value in preserved.insert() and explicitly check for the XPtr being null, which happens when the XPtr is serialized and restored.

I also verified that after this PR and recompiling readr with it you can do repeated Install and RStarts within RStudio without crashes.

It would be good to have another set of eyes though, so @kevinushey if you could review it I would appreciate it.

Copy link
Contributor

@kevinushey kevinushey left a comment

Choose a reason for hiding this comment

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

LGTM!

@jimhester jimhester merged commit 04ff57e into master Oct 28, 2020
@jimhester
Copy link
Member Author

Thanks!

@jimhester jimhester deleted the preserve-list-robustness branch October 28, 2020 19:55
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.

handle case where cpp11_preserve_xptr is a null pointer
2 participants