Fix passing of a padded struct to a function

This commit is contained in:
Alexey Prokhin
2011-02-26 20:16:01 +03:00
parent 20e6c65200
commit 70aee84c70
4 changed files with 22 additions and 18 deletions

View File

@@ -258,9 +258,11 @@ LLValue* DtoResolveNestedContext(Loc loc, ClassDeclaration *decl, LLValue *value
LLValue* nest = DtoNestedContext(loc, decl);
// store into right location
size_t idx = decl->vthis->ir.irField->index;
LLValue* gep = DtoGEPi(value,0,idx,"tmp");
DtoStore(DtoBitCast(nest, gep->getType()->getContainedType(0)), gep);
if (!llvm::dyn_cast<llvm::UndefValue>(nest)) {
size_t idx = decl->vthis->ir.irField->index;
LLValue* gep = DtoGEPi(value,0,idx,".vthis");
DtoStore(DtoBitCast(nest, gep->getType()->getContainedType(0)), gep);
}
}
LLValue* DtoNestedContext(Loc loc, Dsymbol* sym)