File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 18
18
#include " type_caster_base.h"
19
19
#include " typeid.h"
20
20
21
- #include < cassert>
22
21
#include < cstddef>
23
22
#include < memory>
24
23
#include < new>
@@ -419,8 +418,10 @@ struct smart_holder_type_caster_load {
419
418
if (sptsls_ptr != nullptr ) {
420
419
// This code is reachable only if there are multiple registered_instances for the
421
420
// same pointee.
422
- assert (reinterpret_cast <PyObject *>(load_impl.loaded_v_h .inst )
423
- != sptsls_ptr->self );
421
+ if (reinterpret_cast <PyObject *>(load_impl.loaded_v_h .inst ) == sptsls_ptr->self ) {
422
+ pybind11_fail (" smart_holder_type_casters loaded_as_shared_ptr failure: "
423
+ " load_impl.loaded_v_h.inst == sptsls_ptr->self" );
424
+ }
424
425
return std::shared_ptr<T>(
425
426
type_raw_ptr,
426
427
shared_ptr_trampoline_self_life_support (load_impl.loaded_v_h .inst ));
You can’t perform that action at this time.
0 commit comments