diff --git a/tools/inspector_protocol/encoding/encoding.cc b/tools/inspector_protocol/encoding/encoding.cc index f7858c9a22ba64..c1078769c7feaf 100644 --- a/tools/inspector_protocol/encoding/encoding.cc +++ b/tools/inspector_protocol/encoding/encoding.cc @@ -833,8 +833,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) { // inspector_protocol, it's not a CBOR limitation), so we check // against the signed max, so that the allowable values are // 0, 1, 2, ... 2^31 - 1. - if (!success || std::numeric_limits::max() < - token_start_internal_value_) { + if (!success || + static_cast(std::numeric_limits::max()) < + static_cast(token_start_internal_value_)) { SetError(Error::CBOR_INVALID_INT32); return; } diff --git a/tools/inspector_protocol/lib/encoding_cpp.template b/tools/inspector_protocol/lib/encoding_cpp.template index 54a46ecd203d4d..6776471b6637c5 100644 --- a/tools/inspector_protocol/lib/encoding_cpp.template +++ b/tools/inspector_protocol/lib/encoding_cpp.template @@ -840,8 +840,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) { // inspector_protocol, it's not a CBOR limitation), so we check // against the signed max, so that the allowable values are // 0, 1, 2, ... 2^31 - 1. - if (!success || std::numeric_limits::max() < - token_start_internal_value_) { + if (!success || + static_cast(std::numeric_limits::max()) < + static_cast(token_start_internal_value_)) { SetError(Error::CBOR_INVALID_INT32); return; }