www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21734] New: VS2019 crash while debugging

https://issues.dlang.org/show_bug.cgi?id=21734

          Issue ID: 21734
           Summary: VS2019 crash while debugging
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: visuald
          Assignee: nobody puremagic.com
          Reporter: demoulin.pierre gmail.com

Visual Studio Community 2019 Version 16.9.2
Visual D 1.1.0
Both updated on march, 19 2021

Here's a simple code that causes VS2019 to crash while debugging.

When you just run (f5) without breakpoint; it works. you have the right
outputs, the code generation and execution are right.

When you execute the main function step by step (f10), VS crash after the 2nd
line.


module tst;

import std.stdio;

int main()
{
        auto f1 = new Foo(null, "parent");
        auto f2 = new Foo(f1, "child");

        writeln (f2.parent.text);
        writeln (f1.child[0].text);

        readln;
    return 0;
}

class Foo {
         disable this();

        this ( Foo p , string txt ) {
                parent = p;
                text = txt;
        }

        string text;

        private Foo     _p;
        private Foo[]   _c;

         property auto child () {return _c;}
         property auto parent () {return _p;}
         property void parent ( Foo value ) {
                if ( ! _p ) {
                        _p = value;
                        if ( _p ) 
                                _p._c[_p._c.length++] = this;
                }
        }
}

--
Mar 19