Thread overview
[Issue 17828] [ICE] Internal error: ddmd/backend/cgcs.c 352 - CTFE appending to an array on a struct from a template
Sep 15, 2017
David Bennett
Sep 15, 2017
b2.temp@gmx.com
Jun 29, 2019
Basile-z
Jun 29, 2019
Basile-z
Jun 29, 2019
Basile-z
Jun 29, 2019
Basile-z
Jun 30, 2019
Dlang Bot
Jul 07, 2019
Dlang Bot
Mar 21, 2020
Basile-z
September 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17828

David Bennett <davidbennett@bravevision.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice

--
September 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17828

b2.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp@gmx.com

--- Comment #1 from b2.temp@gmx.com ---
reduced:

---
struct Content{string[] parts;}

void main(){
    enum Content content = {};
    content.parts ~= "";
}
---

--
June 29, 2019
https://issues.dlang.org/show_bug.cgi?id=17828

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
The root of the problem is a check not done during sema I believe, because the following works

---
struct Content{ubyte parts;}

void main(){
    enum Content content = {};
    content.parts = 2;
}
---

fixing this last example should prevent the ICE as well.
BTW another evidence showing that it's a missing bit in the front end is that
LDC2 crashes too (with the reduced test case of comment #2).

--
June 29, 2019
https://issues.dlang.org/show_bug.cgi?id=17828

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--
June 29, 2019
https://issues.dlang.org/show_bug.cgi?id=17828

--- Comment #3 from Basile-z <b2.temp@gmx.com> ---
The previous example is actually a new regression

--
June 29, 2019
https://issues.dlang.org/show_bug.cgi?id=17828

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=20011

--
June 30, 2019
https://issues.dlang.org/show_bug.cgi?id=17828

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Basile-z updated dlang/dmd pull request #10115 "fix issue 20011, fix issue 17828 - crash or accept write operation on members of manifest constant structs" fixing this issue:

- fix issue 20011, 17828 - crash or accept write operation on members of manifest constant structs

https://github.com/dlang/dmd/pull/10115

--
July 07, 2019
https://issues.dlang.org/show_bug.cgi?id=17828

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #10115 "fix issue 20011, 17828 - crash or accept write operation on members of manifest constant structs" was merged into stable:

- 44469ba0c915f2cc9f017f01a8a738219a130c51 by Basile Burg:
  fix issue 20011, 17828 - crash or accept write operation on members of
manifest constant structs

https://github.com/dlang/dmd/pull/10115

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=17828

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--