summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lau <rlau@redhat.com>2021-08-10 14:02:08 -0400
committerMichaƫl Zasso <targos@protonmail.com>2021-09-04 15:14:51 +0200
commita338c0e07b992bab59ccf48fac344f3e857b1d65 (patch)
tree43339f1e059661d370142862068df093719811f4
parent09630cf199b3f7971cbd758df036e1643d9371a8 (diff)
downloadnode-new-a338c0e07b992bab59ccf48fac344f3e857b1d65.tar.gz
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>
-rw-r--r--tools/inspector_protocol/encoding/encoding.cc5
-rw-r--r--tools/inspector_protocol/lib/encoding_cpp.template5
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/inspector_protocol/encoding/encoding.cc b/tools/inspector_protocol/encoding/encoding.cc
index 46bd67bc13..636281dd8a 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 47662e71ba..d364649114 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;
}