Skip to content

Commit

Permalink
Merge pull request #4798 from 9rnsr/fix14768
Browse files Browse the repository at this point in the history
Issue 14768 - Error: index 174762 overflow for static array
  • Loading branch information
WalterBright committed Jul 5, 2015
2 parents 92c3700 + b91401d commit 64c473c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/mtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -4067,7 +4067,8 @@ Type *TypeSArray::semantic(Loc loc, Scope *sc)
if (mulu(tbn->size(loc), d2, overflow) >= 0x1000000 || overflow) // put a 'reasonable' limit on it
{
Loverflow:
error(loc, "index %llu overflow for static array", (unsigned long long)d1);
error(loc, "%s size %llu * %llu exceeds 16MiB size limit for static array",
toChars(), (unsigned long long)tbn->size(loc), (unsigned long long)d1);
goto Lerror;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/fail_compilation/fail4611.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/fail4611.d(15): Error: index 1000000000 overflow for static array
fail_compilation/fail4611.d(15): Error: Vec[1000000000] size 4 * 1000000000 exceeds 16MiB size limit for static array
---
*/

Expand Down

0 comments on commit 64c473c

Please sign in to comment.