July 11, 2022 Issues » [Issue 23240] dmd compiles 'ok' class invalid to interface if class contains abstract members | |||
|---|---|---|---|
| |||
...the code compiles ok and resulting program segfaults on run ``` import std.stdio; interface ClassInterface... | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
On Friday, 1 July 2022 at 13:44:20 UTC, Chris Katko wrote: No, it... | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
Yep, that's it. moving all code in world.this() to world.initialize() and immediately... | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
````D
bool initialize() //called from main
{
g.world = new world_t;
}
class atlasHandler{}
class animation... | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
On Friday, 1 July 2022 at 13:20:15 UTC, Mike Parker wrote: Here's... | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
world is null because the constructor didn't complete. The segfault happens inside its constructor... | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
Looks like an ordinary null pointer. How did you create the variable? | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
Forgot the last line. That's important because world MUST exist by time elf is... | |||
July 01, 2022 Learn » Re: dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
To add, I cannot even access g.world from inside elf's constructor. ... which is... | |||
July 01, 2022 Learn » dlang bug - accessing module variable from method segfaults only when using module reference directly | |||
|---|---|---|---|
| |||
dmd (but I think LDC also is affected) this bug has bit me multiple times... | |||
Copyright © 1999-2021 by the D Language Foundation