Skip to content

Commit dc0c274

Browse files
danbevtargos
authored andcommitted
test: suppress compiler warning in test_bigint
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: #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]>
1 parent d2e54e5 commit dc0c274

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/js-native-api/test_bigint/test_bigint.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static napi_value TestWords(napi_env env, napi_callback_info info) {
113113
static napi_value CreateTooBigBigInt(napi_env env, napi_callback_info info) {
114114
int sign_bit = 0;
115115
size_t word_count = SIZE_MAX;
116-
uint64_t words[10];
116+
uint64_t words[10] = {0};
117117

118118
napi_value output;
119119

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

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

131131
napi_status status = napi_create_bigint_words(env,

0 commit comments

Comments
 (0)