mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 23:20:40 +03:00
Fix v1.31 regression wrt. unresolved IrAggr (#4312)
And use `IrTypeClass::getVtblType()` to get the vtable LLVM array type, instead of deriving it from the `IrClass::getVtblSymbol()` global (invoking that function may define the vtable!). I've hit some compiler crashes for the Symmetry code base, on Windows only. I guess the problem surfaced due to `-link-defaultlib-shared`, which on Windows causes some vtables of instantiated classes to be defined whenever accessing the vtable symbol. I don't have a reduced test case unfortunately.
This commit is contained in:
parent
58c4b8bdae
commit
5f46c65ab5
5 changed files with 37 additions and 39 deletions
|
@ -46,7 +46,8 @@ LLValue *loadThisPtr(AggregateDeclaration *ad, IrFunction &irfunc) {
|
|||
}
|
||||
|
||||
LLValue *indexVThis(AggregateDeclaration *ad, LLValue* val) {
|
||||
llvm::StructType *st = getIrAggr(ad, true)->getLLStructType();
|
||||
DtoResolveDsymbol(ad);
|
||||
llvm::StructType *st = getIrAggr(ad)->getLLStructType();
|
||||
unsigned idx = getVthisIdx(ad);
|
||||
return DtoLoad(st->getElementType(idx),
|
||||
DtoGEP(st, val, 0, idx, ".vthis"));
|
||||
|
@ -226,7 +227,7 @@ void DtoResolveNestedContext(const Loc &loc, AggregateDeclaration *decl,
|
|||
DtoResolveDsymbol(decl);
|
||||
|
||||
unsigned idx = getVthisIdx(decl);
|
||||
llvm::StructType *st = getIrAggr(decl, true)->getLLStructType();
|
||||
llvm::StructType *st = getIrAggr(decl)->getLLStructType();
|
||||
LLValue *gep = DtoGEP(st, value, 0, idx, ".vthis");
|
||||
DtoStore(DtoBitCast(nest, st->getElementType(idx)), gep);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue