From 4e987cdd75b252c743055f970753cec93cbd7df9 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 9 Jan 2021 19:23:47 -0800 Subject: [PATCH] spv-light-decoder: Drop special case for dim 0 in decode_data_index(). --- src/output/spv/spv-light-decoder.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/output/spv/spv-light-decoder.c b/src/output/spv/spv-light-decoder.c index ce5bd067c9..8426b251dc 100644 --- a/src/output/spv/spv-light-decoder.c +++ b/src/output/spv/spv-light-decoder.c @@ -729,7 +729,7 @@ decode_data_index (uint64_t in, const struct pivot_table *table, size_t *out) { uint64_t remainder = in; - for (size_t i = table->n_dimensions - 1; i > 0; i--) + for (size_t i = table->n_dimensions - 1; i < table->n_dimensions; i--) { const struct pivot_dimension *d = table->dimensions[i]; if (d->n_leaves) @@ -740,10 +740,9 @@ decode_data_index (uint64_t in, const struct pivot_table *table, else out[i] = 0; } - if (remainder >= table->dimensions[0]->n_leaves) + if (remainder) return xasprintf ("out of range cell data index %"PRIu64, in); - out[0] = remainder; return NULL; } -- 2.30.2