mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 14:46:18 +00:00
tools: fix compiler warning in inspector_protocol
error: comparison of integer expressions of different signedness: ‘int’ and ‘uint64_t’ {aka ‘long unsigned int’} [-Werror=sign-compare] 2562 | if (!success || std::numeric_limits<int32_t>::max() < | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 2563 | token_start_internal_value_) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PR-URL: https://github.com/nodejs/node/pull/37573 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
parent
aee3ef523a
commit
ffb34b6d5d
@ -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<int32_t>::max() <
|
||||
token_start_internal_value_) {
|
||||
if (!success ||
|
||||
static_cast<int64_t>(std::numeric_limits<int32_t>::max()) <
|
||||
static_cast<int64_t>(token_start_internal_value_)) {
|
||||
SetError(Error::CBOR_INVALID_INT32);
|
||||
return;
|
||||
}
|
||||
|
@ -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<int32_t>::max() <
|
||||
token_start_internal_value_) {
|
||||
if (!success ||
|
||||
static_cast<int64_t>(std::numeric_limits<int32_t>::max()) <
|
||||
static_cast<int64_t>(token_start_internal_value_)) {
|
||||
SetError(Error::CBOR_INVALID_INT32);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user