comparison gen/toir.cpp @ 150:2c336566ffed trunk

[svn r156] added a testcase for the most annoying bug ever
author lindquist
date Mon, 24 Mar 2008 20:05:44 +0100
parents a27941d00351
children d11848349f97
comparison
equal deleted inserted replaced
149:4c577c2b7229 150:2c336566ffed
1197 1197
1198 ////////////////////////////////////////////////////////////////////////////////////////// 1198 //////////////////////////////////////////////////////////////////////////////////////////
1199 1199
1200 DValue* CastExp::toElem(IRState* p) 1200 DValue* CastExp::toElem(IRState* p)
1201 { 1201 {
1202 assert(type);
1202 Logger::print("CastExp::toElem: %s | %s\n", toChars(), type->toChars()); 1203 Logger::print("CastExp::toElem: %s | %s\n", toChars(), type->toChars());
1203 LOG_SCOPE; 1204 LOG_SCOPE;
1204 1205
1205 DValue* u = e1->toElem(p); 1206 DValue* u = e1->toElem(p);
1206 DValue* v = DtoCast(u, to); 1207 DValue* v = DtoCast(u, to);
2252 else if (func->isAbstract()) 2253 else if (func->isAbstract())
2253 assert(0 && "TODO delegate to abstract method"); 2254 assert(0 && "TODO delegate to abstract method");
2254 else if (func->toParent()->isInterfaceDeclaration()) 2255 else if (func->toParent()->isInterfaceDeclaration())
2255 assert(0 && "TODO delegate to interface method"); 2256 assert(0 && "TODO delegate to interface method");
2256 else 2257 else
2258 {
2259 DtoForceDeclareDsymbol(func);
2257 castfptr = func->irFunc->func; 2260 castfptr = func->irFunc->func;
2261 }
2258 2262
2259 castfptr = DtoBitCast(castfptr, fptr->getType()->getContainedType(0)); 2263 castfptr = DtoBitCast(castfptr, fptr->getType()->getContainedType(0));
2260 DtoStore(castfptr, fptr); 2264 DtoStore(castfptr, fptr);
2261 2265
2262 return new DImValue(type, lval, inplace); 2266 return new DImValue(type, lval, inplace);