Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
July 19, 2005 Compiler crash (passing a temp into an inout func. param.) | ||||
---|---|---|---|---|
| ||||
Compiling this code with DMD 0.128 on both Windows and Linux: void main() { foo(bar()); } void foo(inout int i) {} int bar() { return 10; } will crash the compiler immediately after the error message: error.d(3): bar() is not an lvalue is printed out. |
July 19, 2005 Re: Compiler crash (passing a temp into an inout func. param.) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dave | Dave wrote:
> Compiling this code with DMD 0.128 on both Windows and Linux:
>
> void main() { foo(bar()); }
> void foo(inout int i) {}
> int bar() { return 10; }
>
> will crash the compiler immediately after the error message:
> error.d(3): bar() is not an lvalue
Looks like an extension to the bug I posted not long ago. Apparently the real bug you and I have run into boils down to: inout parameters don't like expressions, including assignments, invocations, and .dup's.
-- Chris Sauls
|
July 20, 2005 Re: Compiler crash (passing a temp into an inout func. param.) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dave | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dave schrieb am Tue, 19 Jul 2005 16:55:02 +0000 (UTC): > > Compiling this code with DMD 0.128 on both Windows and Linux: > > void main() { foo(bar()); } > void foo(inout int i) {} > int bar() { return 10; } > > will crash the compiler immediately after the error message: > > error.d(3): bar() is not an lvalue > > is printed out. - -> dmd/src/dmd/expression.c:517 -----BEGIN PGP SIGNATURE----- iD8DBQFC3fAg3w+/yD4P9tIRAlfjAJ44gR6ru5gk9yAH6H0RS9o4bfbjrgCdEMzf efh27o2ANs9bKPY0b2hUZYg= =If4g -----END PGP SIGNATURE----- |
July 20, 2005 Re: Compiler crash (passing a temp into an inout func. param.) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | Thomas Kuehne wrote: > - -> dmd/src/dmd/expression.c:517 # # Expression *Expression::toLvalue(Expression *e) # # { # # if (!e) # # e = this; # # else if (!loc.filename) # # loc = e->loc; # # error("%s is not an lvalue", e->toChars()); #this one --># *(char*)0=0; # # return this; # # } I'm confounded. -- Chris Sauls |
July 20, 2005 Re: Compiler crash (passing a temp into an inout func. param.) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Sauls | "Chris Sauls" <ibisbasenji@gmail.com> wrote in message news:dbkrgj$1kq5$1@digitaldaemon.com... > Thomas Kuehne wrote: >> - -> dmd/src/dmd/expression.c:517 > > # # Expression *Expression::toLvalue(Expression *e) > # # { > # # if (!e) > # # e = this; > # # else if (!loc.filename) > # # loc = e->loc; > # # error("%s is not an lvalue", e->toChars()); > #this one --># *(char*)0=0; > # # return this; > # # } > > I'm confounded. Oh. Oh, my. Well that explains all these crashes. |
July 23, 2005 Re: Compiler crash (passing a temp into an inout func. param.) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Sauls | "Chris Sauls" <ibisbasenji@gmail.com> wrote in message news:dbkrgj$1kq5$1@digitaldaemon.com... > Thomas Kuehne wrote: > > - -> dmd/src/dmd/expression.c:517 > > # # Expression *Expression::toLvalue(Expression *e) > # # { > # # if (!e) > # # e = this; > # # else if (!loc.filename) > # # loc = e->loc; > # # error("%s is not an lvalue", e->toChars()); > #this one --># *(char*)0=0; > # # return this; > # # } > > I'm confounded. LOL. That's detritus left over from debugging. I insert those so it'll die at runtime under the debugger, giving me a stack trace. Sometimes, I forget to remove them. |
Copyright © 1999-2021 by the D Language Foundation