mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
No context ptr for nested non-extern(D) functions (#2809)
This commit is contained in:
parent
1704ce63a2
commit
d534d370a8
2 changed files with 15 additions and 3 deletions
|
@ -1813,11 +1813,11 @@ FuncDeclaration *getParentFunc(Dsymbol *sym) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// Static functions and function (not delegate) literals don't allow
|
||||
// access to a parent context, even if they are nested.
|
||||
// Static/non-extern(D) functions and function (not delegate) literals don't
|
||||
// allow access to a parent context, even if they are nested.
|
||||
if (FuncDeclaration *fd = sym->isFuncDeclaration()) {
|
||||
bool certainlyNewRoot =
|
||||
fd->isStatic() ||
|
||||
fd->isStatic() || fd->linkage != LINKd ||
|
||||
(fd->isFuncLiteralDeclaration() &&
|
||||
static_cast<FuncLiteralDeclaration *>(fd)->tok == TOKfunction);
|
||||
if (certainlyNewRoot) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue