Bug 7187 – Regression(head 12d62ca5): [CTFE] ICE on slicing
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-12-30T21:57:00Z
Last change time
2012-01-14T17:40:03Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2011-12-30T21:57:23Z
It compiles with dmd 2.057. But with head commit (12d62ca5):
Assertion failure: '((ArrayLiteralExp *)se->e1)->ownedByCtfe' on line 6315 in file 'interpret.c'
---
int[] f() { return [0]; }
int g(int[] r)
{
auto t = r[0..0];
return 0;
}
static assert(g(f()) == 0);
---
Comment #2 by verylonglogin.reg — 2011-12-31T23:59:25Z
If an argument is added to `f` with head commit (227769c4):
Assertion failure: '((ArrayLiteralExp *)se->e1)->ownedByCtfe' on line 6307 in file 'interpret.c'
---
int[] f(int) { return [0]; }
int g(int[] r)
{
auto t = r[0..0];
return 0;
}
static assert(g(f(0)) == 0);
---
Comment #4 by verylonglogin.reg — 2012-01-08T05:49:39Z
If const cast and struct are added, with head commit (d2b8eadf):
Assertion failure: '((ArrayLiteralExp *)se->e1)->ownedByCtfe' on line 6337 in file 'interpret.c'
---
struct S { const(int)[] field; }
const(int)[] f() {
int[] arr = [];
const(int)[] str = arr;
auto s = S(str);
return s.field;
}
int g(const(int)[] r)
{
auto t = r[0..0];
return 0;
}
static assert(g(f()) == 0);
---
This affects Appender using with CTFE.