Skip to content

Commit 18ae74c

Browse files
committed
src: suppress coverity message
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]>
1 parent 89ede72 commit 18ae74c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_buffer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ inline MUST_USE_RESULT bool ParseArrayIndex(Local<Value> arg,
209209

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

0 commit comments

Comments
 (0)