-
-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Issue 15985 - [REG2.068/2.069] Code doesn't link unless compiled … #14855
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla references
|
| @@ -6259,7 +6259,6 @@ extern (C++) class TemplateInstance : ScopeDsymbol | |||
| TemplateInstance tnext = this.tnext; | |||
| TemplateInstance tinst = this.tinst; | |||
| this.tnext = null; | |||
| this.tinst = null; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs explanation in comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, needs an explanation. :-)
a6e1504
to
50f4d06
Compare
|
I'd prefer @kinke to have a review of this as well. |
50f4d06
to
dc61562
Compare
|
Before Iain's recent refactoring of this function, it was absolutely crucial that both fields were cleared, so that subsequent invocations for the same instance just returned the cached result based on Now after the refactoring, there should be way less invocations. But clearly the result shouldn't change for later invocations, regardless of whether the |
|
The problem was that clearing the tinst meant the compiler lost track of the context that indicated that an instantiation needed to have code generated for it. People have been struggling for years attempting to figure out why sometimes templates were not emitted to the code generator. This fix looks like the solution. @kinke if you have a better fix, by all means submit it! |
The bug with that is the 1st call did not need code generated, and the second call did. Hence the |
I don't think my refactoring has anything to do with a bug that has been around since 2.068. The only logic change was the enforcement of going through the primary instance. By and large the rest tried to stay true to the original (minus redundant checking). Besides, only the |
And that's the bug right there. A unique template instantiation's |
|
What I'm trying to say is that the original idea was that |
There seems to be some cyclic link happening between tinst and text, where for example the 3rd tinst in |
|
Ugh, ouch... okay for such cycles in the graph, unlinking |
|
An |
dc61562
to
8bbfd9d
Compare
8bbfd9d
to
75b3049
Compare
this error makes no sense at all |
75b3049
to
a476bc1
Compare
|
I guess that error was a heisenbug or cleared up with a rebase. |
|
@JohanEngelen @kinke testing this against industry would be appreciated. |
Tested on weka's default build process, worked without linking issues. (sorry for the delay) |
…with -debug
Can it really be this simple? Let's see!