From: Ben Pfaff Date: Sun, 10 Jan 2021 03:23:47 +0000 (-0800) Subject: spv-light-decoder: Drop special case for dim 0 in decode_data_index(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e987cdd75b252c743055f970753cec93cbd7df9;p=pspp spv-light-decoder: Drop special case for dim 0 in decode_data_index(). --- 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; }