mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Increment vgates in static constructors. That fixes static destructors of templates.
This commit is contained in:
parent
a86f414bc1
commit
8a49067776
4 changed files with 39 additions and 13 deletions
|
@ -509,9 +509,11 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
|||
}
|
||||
}
|
||||
// shared static dtor
|
||||
else if (fdecl->isSharedStaticDtorDeclaration()) {
|
||||
else if (StaticDtorDeclaration *dtorDecl = fdecl->isSharedStaticDtorDeclaration()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->sharedDtors.push_front(fdecl);
|
||||
if (dtorDecl->vgate)
|
||||
gIR->sharedGates.push_front(dtorDecl->vgate);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
|
@ -522,9 +524,13 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
|||
}
|
||||
}
|
||||
// static dtor
|
||||
else if (fdecl->isStaticDtorDeclaration()) {
|
||||
else if (StaticDtorDeclaration *dtorDecl = fdecl->isStaticDtorDeclaration()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->dtors.insert(gIR->dtors.begin(), fdecl);
|
||||
gIR->dtors.push_front(fdecl);
|
||||
#if DMDV2
|
||||
if (dtorDecl->vgate)
|
||||
gIR->gates.push_front(dtorDecl->vgate);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue