From c85be5e3981e015d0e71724bcf798072c461518f Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 20 Feb 2011 18:03:39 +0100 Subject: [PATCH] Clarify tuple index out of bounds error message. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, there would be confusing messages like »tuple index 1 exceeds 1«. This change makes it clear that the second integer is the tuple length. --- src/iasm.c | 2 +- src/mtype.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iasm.c b/src/iasm.c index eba2a89bfd0b..169bef924041 100644 --- a/src/iasm.c +++ b/src/iasm.c @@ -2001,7 +2001,7 @@ STATIC OPND *asm_merge_opnds(OPND *o1, OPND *o2) size_t index = o2->disp; if (index >= tup->objects->dim) - error(asmstate.loc, "tuple index %u exceeds %u", index, tup->objects->dim); + error(asmstate.loc, "tuple index %u exceeds length %u", index, tup->objects->dim); else { Object *o = (Object *)tup->objects->data[index]; diff --git a/src/mtype.c b/src/mtype.c index f35fd279eb25..4fcad4bec493 100644 --- a/src/mtype.c +++ b/src/mtype.c @@ -3266,7 +3266,7 @@ void TypeSArray::resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol sc = sc->pop(); if (d >= td->objects->dim) - { error(loc, "tuple index %ju exceeds %u", d, td->objects->dim); + { error(loc, "tuple index %ju exceeds length %u", d, td->objects->dim); goto Ldefault; } Object *o = (Object *)td->objects->data[(size_t)d];