aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/protobuf/patches/disable-utf8-validation-at-release.patch
blob: 67b399b669a71147d68b5c0e2d33846dd172af57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- a/src/google/protobuf/wire_format_lite.cc
+++ b/src/google/protobuf/wire_format_lite.cc
@@ -604,6 +604,7 @@
 void PrintUTF8ErrorLog(absl::string_view message_name,
                        absl::string_view field_name, const char* operation_str,
                        bool emit_stacktrace) {
+  #ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
   TProtoStringType stacktrace;
   (void)emit_stacktrace;  // Parameter is used by Google-internal code.
   std::string quoted_field_name = "";
@@ -624,6 +625,12 @@
                    "send raw bytes. ",
                    stacktrace);
   ABSL_LOG(ERROR) << error_message;
+  #else
+  (void)message_name;
+  (void)field_name;
+  (void)emit_stacktrace;
+  (void)operation_str;
+  #endif
 }
 
 bool WireFormatLite::VerifyUtf8String(const char* data, int size, Operation op,