www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Compiler crash - Assertion failure: '0' on line 622 in file 'glue.c'

reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
Very odd bug.

I managed to narrow it down to this:

class A
{

}

class I
{
    int fork(fn);
}

alias int function(A a) fn;

The compiler crashes and gives the error in the topic title.

Here are some other "features":

It will still give the error if A is a struct.

It will still give the error if I is an interface.

It will not give the error if fn's parameter is anything other than a class 
or struct, i.e. if you use "int a," it compiles.

It will not give the error if you change "alias" to "typedef."

And this takes the cake: it will not give the error if you move the function 
alias to before the class I definition. 
Mar 25 2005
next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
news:d21vhg$pld$1 digitaldaemon.com...
 Very odd bug.
Forgot to mention - this error only happens when the -g compiler switch is used. I came across this when I tried to add debug info to one of my projects, and I got this very strange error.
Mar 25 2005
parent =?ISO-8859-1?Q?Thomas_K=FChne?= <thomas-dloop kuehne.THISISSPAM.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jarrett Billingsley wrote:
| "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message
| news:d21vhg$pld$1 digitaldaemon.com...
|
|>Very odd bug.
|
|
| Forgot to mention - this error only happens when the -g compiler
| switch is used.  I came across this when I tried to add debug info
| to one of my projects, and I got this very strange error.

Added to DStress as
http://dstress.kuehne.cn/run/debug_info_03.d
http://dstress.kuehne.cn/run/debug_info_04.d
http://dstress.kuehne.cn/run/debug_info_05.d
http://dstress.kuehne.cn/run/debug_info_06.d

Thomas


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCRQUA3w+/yD4P9tIRAtUIAJoCtIejENNXUml6GPtvXLvEwcHOeQCg0qMK
CULAb+Gho/lPPF2WEISfFXc=
=vKQ2
-----END PGP SIGNATURE-----
Mar 25 2005
prev sibling parent "Walter" <newshound digitalmars.com> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message
news:d21vhg$pld$1 digitaldaemon.com...
 class A
 {

 }

 class I
 {
     int fork(fn);
 }

 alias int function(A a) fn;

 The compiler crashes and gives the error in the topic title.
The problem is the forward reference to fn. I've fixed the compiler now to detect it.
Apr 05 2005