mirror of
https://github.com/ZDoom/acc.git
synced 2025-03-13 03:42:17 +00:00
- 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:
parent
9a0392a8d2
commit
98cd068a97
1 changed files with 2 additions and 2 deletions
4
parse.c
4
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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue