From 75c0461123248c0b17f049d878507e51769b07b6 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 23 May 2025 00:56:19 +0200 Subject: [PATCH] No issue - Force C++ run-time type information on protobuf Protobuf uses `dynamic_cast` on polymorphic types which cannot be inferred properly at compile-time, which can lead to unexpected behavior. As a code safety measure, enable C++ RTTI for protobuf. --- toolkit/components/protobuf/moz.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toolkit/components/protobuf/moz.build b/toolkit/components/protobuf/moz.build index 41c6f3d75e..633bb76585 100644 --- a/toolkit/components/protobuf/moz.build +++ b/toolkit/components/protobuf/moz.build @@ -130,6 +130,11 @@ elif CONFIG['_MSC_VER']: '-wd4099', # mismatched class/struct tags ] +if CONFIG['_MSC_VER']: + CXXFLAGS += [ + '-GR', # protobuf uses dynamic_cast on polymorphic types + ] + if CONFIG['MOZ_USE_PTHREADS']: DEFINES['HAVE_PTHREAD'] = True