Skip to content

Commit

Permalink
Fix bug 8601: CTFE ICE on dstring[].toUpper
Browse files Browse the repository at this point in the history
This error is spurious, the assert is incorrect.
  • Loading branch information
don-clugston-sociomantic committed Sep 4, 2012
1 parent 9699445 commit c5e0be4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/interpret.c
Expand Up @@ -7084,8 +7084,6 @@ bool isCtfeValueValid(Expression *newval)
assert(se->lwr && se->lwr != EXP_CANT_INTERPRET && se->lwr->op == TOKint64);
assert(se->upr && se->upr != EXP_CANT_INTERPRET && se->upr->op == TOKint64);
assert(se->e1->op == TOKarrayliteral || se->e1->op == TOKstring);
if (se->e1->op == TOKarrayliteral)
assert(((ArrayLiteralExp *)se->e1)->ownedByCtfe);
return true;
}
if (newval->op == TOKvoid)
Expand Down
12 changes: 12 additions & 0 deletions test/compilable/interpret3.d
Expand Up @@ -1253,6 +1253,18 @@ void baz7770()
static assert( bug7770b(foo7770[ $ - 2 ]));
}

/**************************************************
8601 ICE
**************************************************/

dchar bug8601(dstring s) {
dstring w = s[1..$];
return w[0];
}

enum dstring e8601 = [cast(dchar)'o', 'n'];
static assert(bug8601(e8601) == 'n');

/**************************************************
Bug 6015
**************************************************/
Expand Down

0 comments on commit c5e0be4

Please sign in to comment.