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 None check in variant caster #318

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

yosh-matsuda
Copy link
Contributor

This PR fixes the missing None check in the std::variant caster.

The following code produces SIGABRT at runtime since the change in 1220156;

m.def("variant_copyable_none", [](std::variant<int, Copyable, std::monostate> &) {}, nb::arg("x").none());
t.variant_copyable_none(None)

This PR include

  • Improve test coverage
  • Revert the None check
  • Refactoring of redundant code

@wjakob wjakob merged commit d1ad3b9 into wjakob:master Oct 9, 2023
@wjakob
Copy link
Owner

wjakob commented Oct 9, 2023

Thank you!

@yosh-matsuda yosh-matsuda deleted the fix-variant-caster branch October 9, 2023 18:19
@wjakob
Copy link
Owner

wjakob commented Oct 9, 2023

This was kind of a serious issue that also needed to be fixed elsewhere. See commit 5f25ae0.

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.

2 participants