www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 156] New: Inheriting nested classes and "-inline" throws access violation

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=156

           Summary: Inheriting nested classes and "-inline" throws access
                    violation
           Product: D
           Version: 0.157
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: sky quit-clan.de


The following code throws an access violation when compiled with "-inline". It
works fine with other compiler flags.

------------------------------------------

module nestedclass2;

private import std.stdio;

class Foo
{
    class Bar
    {
        void doSayHello()
        {
            sayHello();
        }
    }
    Bar bar;

    void sayHello()
    {
        writefln("Hello");
    }

    this()
    {
        bar = new Bar();
    }
}

class Foo2 : Foo
{
}

int main(char[][] argv)
{
    Foo2 foo = new Foo2();
    writefln("This should print Hello:");
    foo.bar.doSayHello();

    return 0;
}


-- 
May 24 2006
next sibling parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-05-24:
 http://d.puremagic.com/bugzilla/show_bug.cgi?id=156

 The following code throws an access violation when compiled with "-inline". It
 works fine with other compiler flags.

 ------------------------------------------

 module nestedclass2;

 private import std.stdio;

 class Foo
 {
     class Bar
     {
         void doSayHello()
         {
             sayHello();
         }
     }
     Bar bar;

     void sayHello()
     {
         writefln("Hello");
     }

     this()
     {
         bar = new Bar();
     }
 }

 class Foo2 : Foo
 {
 }

 int main(char[][] argv)
 {
     Foo2 foo = new Foo2();
     writefln("This should print Hello:");
     foo.bar.doSayHello();

     return 0;
 }

Added to DStress as http://dstress.kuehne.cn/run/i/inline_16_A.d http://dstress.kuehne.cn/run/i/inline_16_B.d http://dstress.kuehne.cn/run/i/inline_16_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEftt63w+/yD4P9tIRAkzgAKDIg5OyM+oKNhZq9jtxltkDav1b/QCgqL4t UDmyCG1+u0bYJYkDVmKJQlc= =XrOb -----END PGP SIGNATURE-----
Jun 01 2006
parent Markus Dangl <danglm in.tum.de> writes:
 Added to DStress as
 http://dstress.kuehne.cn/run/i/inline_16_A.d
 http://dstress.kuehne.cn/run/i/inline_16_B.d
 http://dstress.kuehne.cn/run/i/inline_16_C.d
 
 Thomas

Thanks for all the effort you're putting into DStress!
Jun 03 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=156


bugzilla digitalmars.com changed:

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




------- Comment #1 from bugzilla digitalmars.com  2006-06-04 22:16 -------
Fixed in DMD 0.160


-- 
Jun 04 2006