mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Correctly set 'outer' reference of nested inner classes.
Fixes DMD testcase 'test11'.
This commit is contained in:
@@ -244,7 +244,11 @@ LLValue* DtoNestedContext(Loc loc, Dsymbol* sym)
|
||||
AggregateDeclaration* ad = irfunc->decl->isMember2();
|
||||
val = ad->isClassDeclaration() ? DtoLoad(irfunc->thisArg) : irfunc->thisArg;
|
||||
if (!ad->vthis)
|
||||
return llvm::UndefValue::get(getVoidPtrType());
|
||||
{
|
||||
// This is just a plain 'outer' reference of a class nested in a
|
||||
// function (but without any variables in the nested context).
|
||||
return val;
|
||||
}
|
||||
#else
|
||||
ClassDeclaration* ad = irfunc->decl->isMember2()->isClassDeclaration();
|
||||
val = DtoLoad(irfunc->thisArg);
|
||||
|
||||
Reference in New Issue
Block a user