www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Compiler crash - (in)out of wrong type

reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
DMD 0.128, Windows XP SP2.
--
void asdf(inout int foobar) {}

void main() {
	uint foo;

	asdf(foo);
}
--
The types can be anything, as long as they don't match.
Also, foobar must be out or inout.

Result:
Error "cast(int)(foo) is not an lvalue".
And the compiler crash, of course: "dmd.exe has encountered a problem", etc.
Aug 06 2005
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Deewiant" <deewiant.doesnotlike.spam gmail.com> wrote in message 
news:dd23vv$1bgq$1 digitaldaemon.com...
 DMD 0.128, Windows XP SP2.
 --
 void asdf(inout int foobar) {}

 void main() {
 uint foo;

 asdf(foo);
 }
 --
 The types can be anything, as long as they don't match.
 Also, foobar must be out or inout.

 Result:
 Error "cast(int)(foo) is not an lvalue".
 And the compiler crash, of course: "dmd.exe has encountered a problem", 
 etc.
All "invalid lvalue" errors will result in a crash, as Walter has inserted a *cast(void*)0=0 in the function that detects invalid lvalues as a debugging aid, and he never took it out when he released 0.128. It'll be gone next patch (I hope).
Aug 06 2005
parent Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Jarrett Billingsley wrote:
 All "invalid lvalue" errors will result in a crash, as Walter has inserted a 
 *cast(void*)0=0 in the function that detects invalid lvalues as a debugging 
 aid, and he never took it out when he released 0.128.  It'll be gone next 
 patch (I hope). 
 
Ah, thanks. That explains a couple of bugs I've submitted here, and I probably would have submitted more if you hadn't told me this :-)
Aug 06 2005