comparison gen/toir.cpp @ 397:9ec89aad9dbc

Make an unresolved global into an error instead of an assert. Fixes nocompile/alias_28_A/F.
author Christian Kamm <kamm incasoftware de>
date Sat, 26 Jul 2008 15:23:15 +0200
parents 3f98d46e05a4
children 0e6b4d65d3f8
comparison
equal deleted inserted replaced
396:b0feb180ce55 397:9ec89aad9dbc
242 if (vd->isDataseg() || (vd->storage_class & STCextern)) { 242 if (vd->isDataseg() || (vd->storage_class & STCextern)) {
243 vd->toObjFile(0); // TODO: multiobj 243 vd->toObjFile(0); // TODO: multiobj
244 DtoConstInitGlobal(vd); 244 DtoConstInitGlobal(vd);
245 } 245 }
246 if (!vd->ir.getIrValue() || DtoType(vd->type)->isAbstract()) { 246 if (!vd->ir.getIrValue() || DtoType(vd->type)->isAbstract()) {
247 Logger::println("global variable not resolved :/ %s", vd->toChars()); 247 error("global variable %s not resolved", vd->toChars());
248 Logger::cout() << *DtoType(vd->type) << '\n'; 248 Logger::cout() << "unresolved global had type: " << *DtoType(vd->type) << '\n';
249 assert(0); 249 fatal();
250 } 250 }
251 return new DVarValue(vd, vd->ir.getIrValue(), true); 251 return new DVarValue(vd, vd->ir.getIrValue(), true);
252 } 252 }
253 } 253 }
254 else if (FuncDeclaration* fdecl = var->isFuncDeclaration()) 254 else if (FuncDeclaration* fdecl = var->isFuncDeclaration())