From 98cd068a972b5e7ef28116c73c2059cfbf5200b2 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 5 Feb 2008 22:41:30 +0000 Subject: [PATCH] - Fixed: ACC multiplied array indices one too many times when an optional index for a multidimensional array was omitted. SVN r732 (trunk) --- parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index 17cc0ed..30c351b 100644 --- a/parse.c +++ b/parse.c @@ -3739,10 +3739,10 @@ static void ParseArrayIndices(symbolNode_t *sym, int requiredIndices) TK_NextToken(); } // if there were unspecified indices, multiply the offset by their sizes [JB] - if(requiredIndices < sym->info.array.ndim) + if(requiredIndices < sym->info.array.ndim - 1) { int i, mult = 1; - for(i = 0; i < sym->info.array.ndim - requiredIndices; ++i) + for(i = 0; i < sym->info.array.ndim - requiredIndices - 1; ++i) { mult *= sym->info.array.dimensions[sym->info.array.ndim - 2 - i]; }