mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-12 17:26:13 +00:00
Fix crash in def_readwrite for non-smart-holder properties of smart-holder classes (v2) (#6008)
* Add tests that cause crash in def_readwrite
- Occurs with non-smart-holder property of smart-holder class
* Fix crash in def_readwrite for non-smart-holder properties of smart-holder classes
* Use default policy
* Address PR comments
* Add test for cast error path
* style: pre-commit fixes
* Revert "Use default policy"
This reverts commit b299f32104.
* Disable test_shared_ptr_return_for_unique_ptr_holder when PYBIND11_TEST_SMART_HOLDER=ON
* Add counterexample
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
This commit is contained in:
@@ -96,6 +96,12 @@ PYBIND11_MODULE(pybind11_tests, m, py::mod_gil_not_used()) {
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
m.attr("PYBIND11_TEST_SMART_HOLDER") =
|
||||
#if defined(PYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE)
|
||||
true;
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
|
||||
bind_ConstructorStats(m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user