Skip to content

Commit

Permalink
test: suppress compiler warning in test_bigint
Browse files Browse the repository at this point in the history
Currently the are two of following compiler warnings is
generated:

In file included from ../test_bigint.c:5:
../test_bigint.c: In function ‘CreateTooBigBigInt’:
../test_bigint.c:120:22: warning:
‘words’ may be used uninitialized [-Wmaybe-uninitialized]

This commit initialized the words array to avoid these warnings.

PR-URL: nodejs#40253
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
danbev committed Oct 1, 2021
1 parent 1e89238 commit 35dc386
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/js-native-api/test_bigint/test_bigint.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static napi_value TestWords(napi_env env, napi_callback_info info) {
static napi_value CreateTooBigBigInt(napi_env env, napi_callback_info info) {
int sign_bit = 0;
size_t word_count = SIZE_MAX;
uint64_t words[10];
uint64_t words[10] = {0};

napi_value output;

Expand All @@ -125,7 +125,7 @@ static napi_value CreateTooBigBigInt(napi_env env, napi_callback_info info) {

// Test that we correctly forward exceptions from the engine.
static napi_value MakeBigIntWordsThrow(napi_env env, napi_callback_info info) {
uint64_t words[10];
uint64_t words[10] = {0};
napi_value output;

napi_status status = napi_create_bigint_words(env,
Expand Down

0 comments on commit 35dc386

Please sign in to comment.