From f9741d18f6ad8c1aeff93109bda30ff99a687766 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 13 Mar 2020 15:06:10 +1100 Subject: unix/coverage: Init all pairheap test nodes before using them. --- ports/unix/coverage.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ports/unix/coverage.c') diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 59fcf5524..7169c7793 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -149,6 +149,9 @@ STATIC int pairheap_lt(mp_pairheap_t *a, mp_pairheap_t *b) { // ops array contain operations: x>=0 means push(x), x<0 means delete(-x) STATIC void pairheap_test(size_t nops, int *ops) { mp_pairheap_t node[8]; + for (size_t i = 0; i < MP_ARRAY_SIZE(node); ++i) { + mp_pairheap_init_node(pairheap_lt, &node[i]); + } mp_pairheap_t *heap = mp_pairheap_new(pairheap_lt); printf("create:"); for (size_t i = 0; i < nops; ++i) { -- cgit v1.2.3