mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Version out inexpressible assert using getPointerElementType() (#4106)
This commit is contained in:
parent
03e35c5ce5
commit
8781a8f1ca
1 changed files with 2 additions and 0 deletions
|
@ -1950,6 +1950,7 @@ DValue *makeVarDValue(Type *type, VarDeclaration *vd, llvm::Value *storage) {
|
||||||
expectedType = expectedType->getPointerTo();
|
expectedType = expectedType->getPointerTo();
|
||||||
|
|
||||||
if (val->getType() != expectedType) {
|
if (val->getType() != expectedType) {
|
||||||
|
#if LDC_LLVM_VER < 1500
|
||||||
// The type of globals is determined by their initializer, and the front-end
|
// The type of globals is determined by their initializer, and the front-end
|
||||||
// may inject implicit casts for class references and static arrays.
|
// may inject implicit casts for class references and static arrays.
|
||||||
assert(vd->isDataseg() || (vd->storage_class & STCextern) ||
|
assert(vd->isDataseg() || (vd->storage_class & STCextern) ||
|
||||||
|
@ -1962,6 +1963,7 @@ DValue *makeVarDValue(Type *type, VarDeclaration *vd, llvm::Value *storage) {
|
||||||
// work as well.
|
// work as well.
|
||||||
assert(getTypeStoreSize(DtoType(type)) <= getTypeStoreSize(pointeeType) &&
|
assert(getTypeStoreSize(DtoType(type)) <= getTypeStoreSize(pointeeType) &&
|
||||||
"LValue type mismatch, encountered type too small.");
|
"LValue type mismatch, encountered type too small.");
|
||||||
|
#endif
|
||||||
val = DtoBitCast(val, expectedType);
|
val = DtoBitCast(val, expectedType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue