mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 16:11:08 +03:00
Improve robustness for TypeInfos of speculative types by only eliding their TypeInfo definition, not the declaration of the LL global altogether. `DtoTypeInfoOf()` expects the LL global to be created and otherwise fails with an assertion or segfault (e.g., issue #2357). So now only linker errors should result in case the TypeInfo definition is missing. Also normalize the calls to `DtoTypeInfoOf()` and revise the following pointer bitcasts, as the LL type of forward-declared TypeInfo globals may be opaque.
This commit is contained in:
parent
fa5f318d3a
commit
d1b30d627c
8 changed files with 38 additions and 44 deletions
|
@ -438,7 +438,7 @@ static LLConstant *build_offti_entry(ClassDeclaration *cd, VarDeclaration *vd) {
|
|||
inits[0] = DtoConstSize_t(offset);
|
||||
|
||||
// TypeInfo ti;
|
||||
inits[1] = DtoTypeInfoOf(vd->type, true);
|
||||
inits[1] = DtoTypeInfoOf(vd->type);
|
||||
|
||||
// done
|
||||
return llvm::ConstantStruct::get(inits);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue