Skip to content

Commit

Permalink
src: suppress coverity message
Browse files Browse the repository at this point in the history
Coverity marked a change in 630096b as a constant expression.
However, on platforms where sizeof(int64_t) > sizeof(size_t),
this should not be the case. This commit flags the comparison
as OK to coverity.

PR-URL: #7587
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
cjihrig committed Aug 10, 2016
1 parent f3e5b39 commit c967af8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ inline MUST_USE_RESULT bool ParseArrayIndex(Local<Value> arg,

// Check that the result fits in a size_t.
const uint64_t kSizeMax = static_cast<uint64_t>(static_cast<size_t>(-1));
// coverity[pointless_expression]
if (static_cast<uint64_t>(tmp_i) > kSizeMax)
return false;

Expand Down

0 comments on commit c967af8

Please sign in to comment.