diff options
author | Richard Lau <rlau@redhat.com> | 2021-08-10 21:02:08 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2021-09-04 16:14:51 +0300 |
commit | a338c0e07b992bab59ccf48fac344f3e857b1d65 (patch) | |
tree | 43339f1e059661d370142862068df093719811f4 /tools | |
parent | 09630cf199b3f7971cbd758df036e1643d9371a8 (diff) |
tools: fix more build warnings in inspector_protocol
PR-URL: https://github.com/nodejs/node/pull/39725
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inspector_protocol/encoding/encoding.cc | 5 | ||||
-rw-r--r-- | tools/inspector_protocol/lib/encoding_cpp.template | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/inspector_protocol/encoding/encoding.cc b/tools/inspector_protocol/encoding/encoding.cc index 46bd67bc135..636281dd8ad 100644 --- a/tools/inspector_protocol/encoding/encoding.cc +++ b/tools/inspector_protocol/encoding/encoding.cc @@ -850,8 +850,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) { // We check the the payload in token_start_internal_value_ against // that range (2^31-1 is also known as // std::numeric_limits<int32_t>::max()). - if (!bytes_read || token_start_internal_value_ > - std::numeric_limits<int32_t>::max()) { + if (!bytes_read || + static_cast<int64_t>(token_start_internal_value_) > + static_cast<int64_t>(std::numeric_limits<int32_t>::max())) { 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 47662e71baf..d3646491140 100644 --- a/tools/inspector_protocol/lib/encoding_cpp.template +++ b/tools/inspector_protocol/lib/encoding_cpp.template @@ -858,8 +858,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) { // We check the the payload in token_start_internal_value_ against // that range (2^31-1 is also known as // std::numeric_limits<int32_t>::max()). - if (!bytes_read || token_start_internal_value_ > - std::numeric_limits<int32_t>::max()) { + if (!bytes_read || + static_cast<int64_t>(token_start_internal_value_) > + static_cast<int64_t>(std::numeric_limits<int32_t>::max())) { SetError(Error::CBOR_INVALID_INT32); return; } |