www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD segv

reply "Kris" <fu bar.com> writes:
This kills DMD v137 (related to the ellipses in Bar.ctor):

class Bar
{
        this(...) {}
}

class Foo
{
        void opAdd (Bar b) {}
}

void main()
{
        auto f = new Foo;
        f + new Bar;
}
Nov 14 2005
next sibling parent reply clayasaurus <clayasaurus gmail.com> writes:
Odd, it doesn't seg under DMD v139 on linux.

Kris wrote:
 This kills DMD v137 (related to the ellipses in Bar.ctor):
 
 class Bar
 {
         this(...) {}
 }
 
 class Foo
 {
         void opAdd (Bar b) {}
 }
 
 void main()
 {
         auto f = new Foo;
         f + new Bar;
 }
 
 
 

Nov 15 2005
parent Don Clugston <dac nospam.com.au> writes:
clayasaurus wrote:
 Odd, it doesn't seg under DMD v139 on linux.

DMD 0.138 on Windows also accepts it without complaint.
 Kris wrote:
 
 This kills DMD v137 (related to the ellipses in Bar.ctor):

 class Bar
 {
         this(...) {}
 }

 class Foo
 {
         void opAdd (Bar b) {}
 }

 void main()
 {
         auto f = new Foo;
         f + new Bar;
 }


Nov 15 2005
prev sibling parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kris schrieb am 2005-11-15:
 This kills DMD v137 (related to the ellipses in Bar.ctor):

 class Bar
 {
         this(...) {}
 }

 class Foo
 {
         void opAdd (Bar b) {}
 }

 void main()
 {
         auto f = new Foo;
         f + new Bar;
 }

What tools and OS did you use and exactly when did DMD crash? Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDfoil3w+/yD4P9tIRAo2sAJ4x/WJveSHGdURM0+dYnb8nvU3vFACeJkH5 srXOzjFF+UXam10xZpTajkM= =yyGd -----END PGP SIGNATURE-----
Nov 18 2005
parent reply "Kris" <fu bar.com> writes:
Build; WinXP; and when compiling ~ WinXP prompts with one of these alerts: 
"dmd.exe has encountered a problem and needs to close. We are sorry for the 
inconvenience."

Removing the ellipses makes it operate fine.


Additionally, this variation:

class Bar
{
        this(int i, ...) {}
}

class Foo
{
        void opAdd (Bar b) {}
}

void main()
{
        auto f = new Foo;
        f + new Bar(1, 0); // error here
}

produces this error:

template.d: constructor template.Bar.this (int,...) does not match argument 
types (TypeInfo[],int,int)
cannot implicitly convert expression (_arguments_i) of type TypeInfo[] to 
int




"Thomas Kuehne" <thomas-dloop kuehne.cn> wrote in message 
news:5ud253-0b4.ln1 birke.kuehne.cn...
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1

 Kris schrieb am 2005-11-15:
 This kills DMD v137 (related to the ellipses in Bar.ctor):

 class Bar
 {
         this(...) {}
 }

 class Foo
 {
         void opAdd (Bar b) {}
 }

 void main()
 {
         auto f = new Foo;
         f + new Bar;
 }

What tools and OS did you use and exactly when did DMD crash? Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDfoil3w+/yD4P9tIRAo2sAJ4x/WJveSHGdURM0+dYnb8nvU3vFACeJkH5 srXOzjFF+UXam10xZpTajkM= =yyGd -----END PGP SIGNATURE-----

Nov 18 2005
parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kris schrieb am 2005-11-19:
 Build; WinXP; and when compiling ~ WinXP prompts with one of these alerts: 
 "dmd.exe has encountered a problem and needs to close. We are sorry for the 
 inconvenience."

 Removing the ellipses makes it operate fine.

I can't reproduce this with WindowsXP and dmd-0.137. Are you sure that this is DMD's fault and not a "virus scanner" or some other "security" tool?
 Additionally, this variation:

 class Bar
 {
         this(int i, ...) {}
 }

 class Foo
 {
         void opAdd (Bar b) {}
 }

 void main()
 {
         auto f = new Foo;
         f + new Bar(1, 0); // error here
 }

 produces this error:

 template.d: constructor template.Bar.this (int,...) does not match argument 
 types (TypeInfo[],int,int)
 cannot implicitly convert expression (_arguments_i) of type TypeInfo[] to 
 int

Added to DStress as http://dstress.kuehne.cn/run/v/variadic_argument_10_A.d http://dstress.kuehne.cn/run/v/variadic_argument_10_B.d http://dstress.kuehne.cn/run/v/variadic_argument_10_C.d http://dstress.kuehne.cn/run/v/variadic_argument_10_D.d http://dstress.kuehne.cn/run/v/variadic_argument_10_E.d http://dstress.kuehne.cn/run/v/variadic_argument_10_F.d Some of those tests crash if "-fPIC" is used: "Internal error: ../ztc/cgelem.c 4574" Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDf6cb3w+/yD4P9tIRAgZyAKDDtN2+hBv+MuQL5XccXK8fCDClpgCgl2Nh 2L2ZDyTIQzi1AZQV2tPxYo0= =cqwf -----END PGP SIGNATURE-----
Nov 19 2005
parent "Kris" <fu bar.com> writes:
"Thomas Kuehne" <thomas-dloop kuehne.cn> wrote..
 Kris schrieb am 2005-11-19:
 Build; WinXP; and when compiling ~ WinXP prompts with one of these 
 alerts:
 "dmd.exe has encountered a problem and needs to close. We are sorry for 
 the
 inconvenience."

 Removing the ellipses makes it operate fine.

I can't reproduce this with WindowsXP and dmd-0.137. Are you sure that this is DMD's fault and not a "virus scanner" or some other "security" tool?

Perhaps ... but then why would it work when the ellipses are removed? It's a mystery.
Nov 19 2005