Skip to content

Commit 8c95410

Browse files
richardlaujasnell
authored andcommittedAug 12, 2021
tools: fix more build warnings in inspector_protocol
PR-URL: nodejs#39725 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a48b9c3 commit 8c95410

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎tools/inspector_protocol/encoding/encoding.cc

+3-2
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

+3-2
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)
Please sign in to comment.