← Back to index
|
Original Bugzilla link
Bug 12110 – [CTFE] Error: CTFE internal error: Dotvar assignment
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-08T11:13:00Z
Last change time
2014-04-21T10:33:13Z
Keywords
CTFE, pull, rejects-valid
Assigned to
nobody
Creator
dmitry.olsh
Comments
Comment #0
by dmitry.olsh — 2014-02-08T11:13:28Z
Dustmited from std.uni: //---start--- struct SliceOverIndexed { @property empty(){ return from ; } @property front(){ return (*arr)[from]; } @property front(Item val) { (*arr)[from] = val; } void popFront() { } alias typeof(Uint24Array.init[0]) Item; size_t from, to; Uint24Array* arr; } uint read24(ubyte* ptr, size_t idx) { return ptr[idx] + ptr[idx+1]; } struct Uint24Array { this(Range)(Range range) { length = range.length; this[].front = range[0]; } @property length() { return data.length ? data.length-4: 0; } @property length(size_t len) { immutable bytes = len*3+4; data = new ubyte[bytes]; } uint opIndex(size_t idx){ return read24(data.ptr, idx); } void opIndexAssign(uint , size_t ) { dupThisReference(); } auto opSlice() { return SliceOverIndexed(0, length, &this); } void dupThisReference( ) { auto new_data = new ubyte[data.length]; data = new_data; } ubyte[] data; } static m2 = Uint24Array([0x80]); //---end--- DMD64 D Compiler v2.065-devel-723cc20 Output: n_test.d(56): Error: CTFE internal error: Dotvar assignment n_test.d(45): called from here: this.dupThisReference() n_test.d(7): called from here: (*this.arr).opIndexAssign(val, this.from) n_test.d(26): called from here: this.opSlice().front(cast(uint)range[0]) n_test.d(62): called from here: (Uint24Array __ctmp1; , __ctmp1).this([128])
Comment #1
by k.hara.pg — 2014-04-21T09:10:59Z
https://github.com/D-Programming-Language/dmd/pull/3480
Comment #2
by github-bugzilla — 2014-04-21T10:33:12Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/44475476772b656e2b2dee5d0f1dcf38eaa056ec
fix Issue 12110 - [CTFE] Error: CTFE internal error: Dotvar assignment
https://github.com/D-Programming-Language/dmd/commit/107999e3de38bc0588ebc28c9c590abd328a7b09
Merge pull request #3480 from 9rnsr/fix12110 Issue 12110 - [CTFE] Error: CTFE internal error: Dotvar assignment