Thread overview
[Issue 12827] [ICE] Segfault on immutable field self-initialization
[Issue 12827] DMD segfaults when affecting immutable member with himself
Jun 02, 2014
matovitch
Aug 14, 2014
Maxim Fomin
Aug 14, 2014
Maxim Fomin
June 02, 2014
https://issues.dlang.org/show_bug.cgi?id=12827

matovitch <camille.brugel@laposte.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|DMD segfaults if the member |DMD segfaults when
                   |variable has the same name  |affecting immutable member
                   |as the template argument    |with himself

--- Comment #1 from matovitch <camille.brugel@laposte.net> ---
In fact it does'nt have to be template you affect an immutable member with himself and it segfaults :

    struct Test
    {
        immutable int i = i;
    }

    void main()
    {}

--
August 14, 2014
https://issues.dlang.org/show_bug.cgi?id=12827

Maxim Fomin <maxim-fomin@outlook.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim-fomin@outlook.com
            Summary|DMD segfaults when          |[ICE] Segfault on immutable
                   |affecting immutable member  |field self-initialization
                   |with himself                |
                 OS|Linux                       |All
           Severity|minor                       |major

--
August 14, 2014
https://issues.dlang.org/show_bug.cgi?id=12827

Maxim Fomin <maxim-fomin@outlook.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice
           Hardware|x86_64                      |All

--
September 03, 2014
https://issues.dlang.org/show_bug.cgi?id=12827

--- Comment #2 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/da3a468db8469192f22851f1887f7bb5d4f3b5ea Fix  Issue 12827 - [ICE] Segfault on immutable field self-initialization

https://github.com/D-Programming-Language/dmd/commit/2117931e57c2319d23dde442e12596141116f0b9 Merge pull request #3871 from maxfom/fix12827

Fix  Issue 12827 - [ICE] Segfault on immutable field self-initialization

--
September 11, 2014
https://issues.dlang.org/show_bug.cgi?id=12827

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |hsteoh@quickfur.ath.cx
         Resolution|---                         |FIXED

--- Comment #3 from hsteoh@quickfur.ath.cx ---
On git HEAD, the first code example now gives a compile error:
-------
test.d(4): Deprecation: variable test.Foo!5.Foo.i immutable field with
initializer should be static, __gshared, or an enum
test.d(4): Error: circular initialization of i
test.d(9): Error: template instance test.Foo!5 error instantiating
-------

The second example also:
-------
test.d(3): Deprecation: variable test.Test.i immutable field with initializer
should be static, __gshared, or an enum
test.d(3): Error: circular initialization of i
-------

Seems the PR has fixed this bug.

--