Skip to content

Commit 52a172f

Browse files
richardlaudanielleadams
authored andcommitted
tools: fix more build warnings in inspector_protocol
PR-URL: #39725 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 77f9c1f commit 52a172f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tools/inspector_protocol/encoding/encoding.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) {
850850
// We check the the payload in token_start_internal_value_ against
851851
// that range (2^31-1 is also known as
852852
// std::numeric_limits<int32_t>::max()).
853-
if (!bytes_read || token_start_internal_value_ >
854-
std::numeric_limits<int32_t>::max()) {
853+
if (!bytes_read ||
854+
static_cast<int64_t>(token_start_internal_value_) >
855+
static_cast<int64_t>(std::numeric_limits<int32_t>::max())) {
855856
SetError(Error::CBOR_INVALID_INT32);
856857
return;
857858
}

tools/inspector_protocol/lib/encoding_cpp.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) {
858858
// We check the the payload in token_start_internal_value_ against
859859
// that range (2^31-1 is also known as
860860
// std::numeric_limits<int32_t>::max()).
861-
if (!bytes_read || token_start_internal_value_ >
862-
std::numeric_limits<int32_t>::max()) {
861+
if (!bytes_read ||
862+
static_cast<int64_t>(token_start_internal_value_) >
863+
static_cast<int64_t>(std::numeric_limits<int32_t>::max())) {
863864
SetError(Error::CBOR_INVALID_INT32);
864865
return;
865866
}

0 commit comments

Comments
 (0)