Skip to content

Commit

Permalink
Merge pull request #3771 from yebblies/signext
Browse files Browse the repository at this point in the history
[DDMD] Make construction of SignExtendedNumber explicit
  • Loading branch information
9rnsr committed Jul 15, 2014
2 parents 08d21d2 + 4fcc599 commit 538f402
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/statement.c
Expand Up @@ -1927,7 +1927,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
{
error("index type '%s' cannot cover index range 0..%llu", arg->type->toChars(), ta->dim->toInteger());
}
key->range = new IntRange(0, dimrange.imax);
key->range = new IntRange(SignExtendedNumber(0), dimrange.imax);
}
}
else
Expand Down Expand Up @@ -2042,7 +2042,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
{
/* Limit the range of the key to the specified range
*/
v->range = new IntRange(key->range->imin, key->range->imax - 1);
v->range = new IntRange(key->range->imin, key->range->imax - SignExtendedNumber(1));
}
}
}
Expand Down Expand Up @@ -2756,7 +2756,7 @@ Statement *ForeachRangeStatement::semantic(Scope *sc)
{
/* Limit the range of the key to the specified range
*/
v->range = new IntRange(key->range->imin, key->range->imax - 1);
v->range = new IntRange(key->range->imin, key->range->imax - SignExtendedNumber(1));
}
}
if (arg->storageClass & STCref)
Expand Down

0 comments on commit 538f402

Please sign in to comment.