← Back to index
|
Original Bugzilla link
Bug 7771 – [ICE][CTFE] With maketrans and string slicing
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-03-25T12:19:00Z
Last change time
2012-04-04T11:57:54Z
Keywords
CTFE, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2012-03-25T12:19:38Z
import std.ascii: letters, uppercase; import std.string: maketrans; immutable r = maketrans(uppercase, uppercase[13 .. $] ~ uppercase[0 .. 13]); void main() {} DMD 2.059head: Assertion failure: '!v->isDataseg() || v->isCTFE()' on line 108 in file 'interpret.c' With small changes it crashes in another point: import std.string: maketrans; void main() { immutable s = "foo"; static r = maketrans(s, s[0 .. $]); } DMD 2.059head: Assertion failure: 'v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()' on line 97 in file 'interpret.c'
Comment #1
by clugdbug — 2012-04-04T11:57:54Z
Patch for bug 7770 fixes this. *** This issue has been marked as a duplicate of issue 7770 ***