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]; }