mirror of
https://github.com/ZDoom/acc.git
synced 2025-03-13 03:42:17 +00:00
- Applied Zom-B's patch for multi-dimension array initializer checks.
SVN r3281 (trunk)
This commit is contained in:
parent
9d2a8cf45e
commit
6e0f75a4d1
1 changed files with 11 additions and 0 deletions
11
parse.c
11
parse.c
|
@ -4071,6 +4071,17 @@ static void ProcessArrayLevel(int level, int *entry, int ndim,
|
|||
}
|
||||
else
|
||||
{
|
||||
//Bugfix for r3226 by Zom-B
|
||||
if (i >= dims[level - 1])
|
||||
{
|
||||
if (!warned_too_many)
|
||||
{
|
||||
warned_too_many = YES;
|
||||
ERR_Error(ERR_TOO_MANY_ARRAY_INIT, YES);
|
||||
}
|
||||
// Allow execution to continue without stray memory access
|
||||
entry -= muls[level-1];
|
||||
}
|
||||
TK_TokenMustBe(TK_LBRACE, ERR_MISSING_LBRACE_ARR);
|
||||
TK_NextToken();
|
||||
ProcessArrayLevel(level+1, entry, ndim, dims, muls, name);
|
||||
|
|
Loading…
Reference in a new issue