mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
Fix out of bounds sequence index error
This commit is contained in:
parent
b84fa4709f
commit
932ec7a37c
3 changed files with 3 additions and 3 deletions
|
@ -10089,7 +10089,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
|
|
||||||
if (length <= index)
|
if (length <= index)
|
||||||
{
|
{
|
||||||
error(exp.loc, "array index `[%llu]` is outside array bounds `[0 .. %llu]`", index, cast(ulong)length);
|
error(exp.loc, "sequence index `[%llu]` is outside bounds `[0 .. %llu]`", index, cast(ulong)length);
|
||||||
return setError();
|
return setError();
|
||||||
}
|
}
|
||||||
Expression e;
|
Expression e;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
TEST_OUTPUT:
|
TEST_OUTPUT:
|
||||||
---
|
---
|
||||||
fail_compilation/fail125.d(15): Error: array index `[2]` is outside array bounds `[0 .. 2]`
|
fail_compilation/fail125.d(15): Error: sequence index `[2]` is outside bounds `[0 .. 2]`
|
||||||
fail_compilation/fail125.d(18): Error: template instance `fail125.main.recMove!(1, a, b)` error instantiating
|
fail_compilation/fail125.d(18): Error: template instance `fail125.main.recMove!(1, a, b)` error instantiating
|
||||||
fail_compilation/fail125.d(25): instantiated from here: `recMove!(0, a, b)`
|
fail_compilation/fail125.d(25): instantiated from here: `recMove!(0, a, b)`
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
TEST_OUTPUT:
|
TEST_OUTPUT:
|
||||||
---
|
---
|
||||||
fail_compilation/ice12539.d(15): Error: array index `[0]` is outside array bounds `[0 .. 0]`
|
fail_compilation/ice12539.d(15): Error: sequence index `[0]` is outside bounds `[0 .. 0]`
|
||||||
---
|
---
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue