Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
August 04, 2004 DMD 0.97: crash with struct sorting | ||||
---|---|---|---|---|
| ||||
DMD 0.97: crash with struct sorting This code causes DMD 0.97 to segfault: struct Foo { int opCmp(Foo f) { return 0; } } int main(char[][] args) { Foo[] foo; foo.sort; return 0; } --- w2000 DMD 0.97 |
August 04, 2004 Re: DMD 0.97: crash with struct sorting | ||||
---|---|---|---|---|
| ||||
Posted in reply to k2 | In article <ceq9g7$25mj$1@digitaldaemon.com>, k2 says... > >DMD 0.97: crash with struct sorting > >This code causes DMD 0.97 to segfault: > >struct Foo { > >int opCmp(Foo f) >{ >return 0; >} >} > >int main(char[][] args) >{ >Foo[] foo; > >foo.sort; > >return 0; >} > >--- >w2000 DMD 0.97 > > Presumably Foo.sizeof is zero, which I imagine would cause problems for sort? Jill |
August 04, 2004 Re: DMD 0.97: crash with struct sorting | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arcane Jill | In article <cerbqk$cus$1@digitaldaemon.com>, Arcane Jill says... > >Presumably Foo.sizeof is zero, which I imagine would cause problems for sort? > >Jill It's the compiler that crashes, not the program. (A simple test also comfirms that .sort doesn't mind empty arrays.) Nick |
August 04, 2004 Re: DMD 0.97: crash with struct sorting | ||||
---|---|---|---|---|
| ||||
Posted in reply to k2 | k2 wrote:
> DMD 0.97: crash with struct sorting
>
> This code causes DMD 0.97 to segfault:
>
> struct Foo {
>
> int opCmp(Foo f)
> {
> return 0;
> }
> }
>
> int main(char[][] args)
> {
> Foo[] foo;
>
> foo.sort;
>
> return 0;
> }
Seems to work on Linux.
|
August 05, 2004 Re: DMD 0.97: crash with struct sorting | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juanjo Álvarez | In article <cers5l$m3a$1@digitaldaemon.com>, Juanjo =?ISO-8859-15?Q?=C1lvarez?= says... > > >Seems to work on Linux. > I get a segfault on Linux, haven't tried Windows (but it should be the same.) Since k2 used the word "segfault" I assume that was on Linux as well. Nick |
Copyright © 1999-2021 by the D Language Foundation