- Fixed: ACC multiplied array indices one too many times when an optional index for a

multidimensional array was omitted.

SVN r732 (trunk)
This commit is contained in:
Randy Heit 2008-02-05 22:41:30 +00:00
parent 9a0392a8d2
commit 98cd068a97

View file

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