mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 23:20:40 +03:00
Resolving nested context for structs.
* * * Another fix for nested structs * * * Yet another fix for nested structs
This commit is contained in:
parent
e3afcf8a8d
commit
360a99caa9
7 changed files with 63 additions and 22 deletions
|
@ -170,16 +170,7 @@ DValue* DtoNewClass(Loc loc, TypeClass* tc, NewExp* newexp)
|
|||
// set the context for nested classes
|
||||
else if (tc->sym->isNested() && tc->sym->vthis)
|
||||
{
|
||||
Logger::println("Resolving nested context");
|
||||
LOG_SCOPE;
|
||||
|
||||
// get context
|
||||
LLValue* nest = DtoNestedContext(loc, tc->sym);
|
||||
|
||||
// store into right location
|
||||
size_t idx = tc->sym->vthis->ir.irField->index;
|
||||
LLValue* gep = DtoGEPi(mem,0,idx,"tmp");
|
||||
DtoStore(DtoBitCast(nest, gep->getType()->getContainedType(0)), gep);
|
||||
DtoResolveNestedContext(loc, tc->sym, mem);
|
||||
}
|
||||
|
||||
// call constructor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue