Skip to content

Commit 3fc1de5

Browse files
Merge bitcoin-core/secp256k1#1364: Avoid -Wmaybe-uninitialized when compiling with gcc -O1
5b9f37f ci: Add `CFLAGS: -O1` to task matrix (Hennadii Stepanov) a6ca76c Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1` (Hennadii Stepanov) Pull request description: Fixes bitcoin-core/secp256k1#1361. CI tasks have been adjusted to catch similar issues in the future. ACKs for top commit: real-or-random: utACK 5b9f37f jonasnick: tACK 5b9f37f Tree-SHA512: 8aa5ec22ed88579ecd37681df68d64f8bab93cd14bdbf432a3af41cadc7ab3eba86c33c179db15bf3a3c798c33064bd845ebdedb02ee617ef634e98c596838c2
2 parents fb758fe + 5b9f37f commit 3fc1de5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.cirrus.yml

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ task:
8080
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETESTS: no, BENCH: no}
8181
- env: {CPPFLAGS: -DDETERMINISTIC}
8282
- env: {CFLAGS: -O0, CTIMETESTS: no}
83+
- env: {CFLAGS: -O1, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
8384
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
8485
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
8586
matrix:

src/ecmult_impl.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ static void secp256k1_ecmult_strauss_wnaf(const struct secp256k1_strauss_state *
288288
}
289289

290290
/* Bring them to the same Z denominator. */
291-
secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
291+
if (no) {
292+
secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
293+
}
292294

293295
for (np = 0; np < no; ++np) {
294296
for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {

0 commit comments

Comments
 (0)