From af8ee518d0cf89f9defd3f334882f289955c0acc Mon Sep 17 00:00:00 2001 From: pybind11_protobuf authors Date: Wed, 29 May 2024 13:44:21 -0700 Subject: [PATCH] Migrate users of dynamic_cast/down_cast on protobuf types to use protobuf cast functions instead. These do not require RTTI to work. PiperOrigin-RevId: 638398786 --- pybind11_protobuf/proto_caster_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybind11_protobuf/proto_caster_impl.h b/pybind11_protobuf/proto_caster_impl.h index e10c0d1..12e693d 100644 --- a/pybind11_protobuf/proto_caster_impl.h +++ b/pybind11_protobuf/proto_caster_impl.h @@ -55,7 +55,7 @@ struct proto_caster_load_impl { const ::google::protobuf::Message *message = pybind11_protobuf::PyProtoGetCppMessagePointer(src); if (message) { - value = dynamic_cast(message); + value = ::google::protobuf::DynamicCastToGenerated(message); if (value) { // If the capability were available, then we could probe PyProto_API and // allow c++ mutability based on the python reference count.