[svn r223] Fixed: assert with message could be broken.

Fixed: array length exp could fail on slice.
This commit is contained in:
Tomas Lindquist Olsen
2008-05-13 21:40:39 +02:00
parent 39ed86269e
commit 1eb35898c6
4 changed files with 25 additions and 8 deletions

View File

@@ -2121,10 +2121,7 @@ DValue* ArrayLengthExp::toElem(IRState* p)
}
else
{
llvm::Value* zero = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0, false);
llvm::Value* ptr = DtoGEP(u->getRVal(),zero,zero,"tmp",p->scopebb());
ptr = new llvm::LoadInst(ptr, "tmp", p->scopebb());
return new DImValue(type, ptr);
return new DImValue(type, DtoArrayLen(u));
}
}