Store the right context frame in nested structs and classes.

This commit is contained in:
Alexey Prokhin
2010-12-19 12:13:00 +03:00
parent f12b95b36a
commit e7c880cd08
2 changed files with 37 additions and 22 deletions

View File

@@ -2597,6 +2597,12 @@ DValue* StructLiteralExp::toElem(IRState* p)
IF_LOG Logger::println("expr %zu = %s", it.index, expr->toChars());
val = expr->toElem(gIR);
}
#if DMDV2
else if (vd == sd->vthis) {
IF_LOG Logger::println("initializing vthis");
val = new DImValue(sd->type, DtoNestedContext(loc, sd));
}
#endif
else
{
IF_LOG Logger::println("using default initializer");