Skip to content

Commit 48bbc19

Browse files
ckennellycopybara-github
authored andcommitted
Cleanup unused, always-false log_debug_utf8_failure flag.
PiperOrigin-RevId: 791779036
1 parent f25580e commit 48bbc19

File tree

4 files changed

+2
-12
lines changed

4 files changed

+2
-12
lines changed

src/google/protobuf/compiler/cpp/parse_function_generator.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,18 +460,15 @@ void ParseFunctionGenerator::GenerateTailCallTable(io::Printer* p) {
460460
p->Emit(
461461
{
462462
{"strict", utf8_check == Utf8CheckMode::kStrict},
463-
// TODO: Remove this.
464-
{"verify", false},
465463
{"validate", validated_enum},
466464
{"key_wire", map_key->type()},
467465
{"value_wire", map_value->type()},
468466
{"is_lite",
469467
!HasDescriptorMethods(aux_entry.field->file(), options_)},
470468
},
471469
R"cc(
472-
{::_pbi::TcParser::GetMapAuxInfo($strict$, $verify$, $validate$,
473-
$key_wire$, $value_wire$,
474-
$is_lite$)},
470+
{::_pbi::TcParser::GetMapAuxInfo(
471+
$strict$, $validate$, $key_wire$, $value_wire$, $is_lite$)},
475472
)cc");
476473
break;
477474
}

src/google/protobuf/generated_message_tctable_decl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,6 @@ struct MapAuxInfo {
253253
uint8_t use_lite : 1;
254254
// If true UTF8 errors cause the parsing to fail.
255255
uint8_t fail_on_utf8_failure : 1;
256-
// If true UTF8 errors are logged, but they are accepted.
257-
uint8_t log_debug_utf8_failure : 1;
258256
// If true the next aux contains the enum validator.
259257
uint8_t value_is_validated_enum : 1;
260258
};

src/google/protobuf/generated_message_tctable_impl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,6 @@ class PROTOBUF_EXPORT TcParser final {
838838

839839
// For `map` mini parsing generate a type card for the key/value.
840840
static constexpr MapAuxInfo GetMapAuxInfo(bool fail_on_utf8_failure,
841-
bool log_debug_utf8_failure,
842841
bool validated_enum_value,
843842
int key_type, int value_type,
844843
bool is_lite) {
@@ -848,7 +847,6 @@ class PROTOBUF_EXPORT TcParser final {
848847
true,
849848
is_lite,
850849
fail_on_utf8_failure,
851-
log_debug_utf8_failure,
852850
validated_enum_value,
853851
};
854852
}

src/google/protobuf/generated_message_tctable_lite.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,9 +2916,6 @@ const char* TcParser::ParseOneMapEntry(
29162916
ptr = ctx->ReadString(ptr, size, str);
29172917
if (ABSL_PREDICT_FALSE(ptr == nullptr)) return nullptr;
29182918
bool do_utf8_check = map_info.fail_on_utf8_failure;
2919-
#ifndef NDEBUG
2920-
do_utf8_check |= map_info.log_debug_utf8_failure;
2921-
#endif
29222919
if (type_card.is_utf8() && do_utf8_check &&
29232920
!utf8_range::IsStructurallyValid(*str)) {
29242921
PrintUTF8ErrorLog(MessageName(table), FieldName(table, &entry),

0 commit comments

Comments
 (0)