mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 08:30:47 +03:00
Fixed accessing struct members via alias this
This commit is contained in:
parent
4879a8bc17
commit
a75b08bc00
1 changed files with 5 additions and 5 deletions
|
@ -705,12 +705,12 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
||||||
LLValue* thisvar = irfunction->thisArg;
|
LLValue* thisvar = irfunction->thisArg;
|
||||||
assert(thisvar);
|
assert(thisvar);
|
||||||
|
|
||||||
LLValue* thismem = DtoRawAlloca(thisvar->getType(), 0, "this"); // FIXME: align?
|
LLValue* thismem = thisvar;
|
||||||
|
if (!f->fty.is_arg_this_ref) {
|
||||||
|
thismem = DtoRawAlloca(thisvar->getType(), 0, "this"); // FIXME: align?
|
||||||
DtoStore(thisvar, thismem);
|
DtoStore(thisvar, thismem);
|
||||||
if (f->fty.is_arg_this_ref)
|
|
||||||
irfunction->thisArg = DtoLoad(thismem, "thisRef");
|
|
||||||
else
|
|
||||||
irfunction->thisArg = thismem;
|
irfunction->thisArg = thismem;
|
||||||
|
}
|
||||||
|
|
||||||
assert(!fd->vthis->ir.irLocal);
|
assert(!fd->vthis->ir.irLocal);
|
||||||
fd->vthis->ir.irLocal = new IrLocal(fd->vthis);
|
fd->vthis->ir.irLocal = new IrLocal(fd->vthis);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue