Another fix for nested context in structs.

This commit is contained in:
Alexey Prokhin
2010-11-05 11:55:23 +03:00
parent 45606689c5
commit 59d1ec5e0b
3 changed files with 7 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ static FuncDeclaration* getParentFunc(Dsymbol* sym, bool stopOnStatic) {
return (parent ? parent->isFuncDeclaration() : NULL);
}
DValue* DtoNestedVariable(Loc loc, Type* astype, VarDeclaration* vd)
DValue* DtoNestedVariable(Loc loc, Type* astype, VarDeclaration* vd, bool byref)
{
Logger::println("DtoNestedVariable for %s @ %s", vd->toChars(), loc.toChars());
LOG_SCOPE;
@@ -150,7 +150,7 @@ DValue* DtoNestedVariable(Loc loc, Type* astype, VarDeclaration* vd)
val = DtoGEPi(val, 0, vd->ir.irLocal->nestedIndex, vd->toChars());
Logger::cout() << "Addr: " << *val << '\n';
Logger::cout() << "of type: " << *val->getType() << '\n';
if (vd->ir.irLocal->byref) {
if (vd->ir.irLocal->byref || byref) {
val = DtoAlignedLoad(val);
Logger::cout() << "Was byref, now: " << *val << '\n';
Logger::cout() << "of type: " << *val->getType() << '\n';