Do not assert on non-existing supposed globals. (see nocompile/union_12,14)

This commit is contained in:
Christian Kamm
2008-08-28 20:15:36 +02:00
parent 7b07ddcbd8
commit 0f92afc5b9

View File

@@ -130,7 +130,7 @@ DValue* VarExp::toElem(IRState* p)
vd->toObjFile(0); // TODO: multiobj
DtoConstInitGlobal(vd);
}
if (!vd->ir.getIrValue() || DtoType(vd->type)->isAbstract()) {
if (!vd->ir.isSet() || !vd->ir.getIrValue() || DtoType(vd->type)->isAbstract()) {
error("global variable %s not resolved", vd->toChars());
Logger::cout() << "unresolved global had type: " << *DtoType(vd->type) << '\n';
fatal();