Fix an incorrect assertion.

llvm-svn: 42951
This commit is contained in:
Anders Carlsson 2007-10-13 05:52:34 +00:00
parent c799fe9ed9
commit d5f857f2e5
1 changed files with 3 additions and 2 deletions

View File

@ -419,8 +419,9 @@ Value *ScalarExprEmitter::VisitImplicitCastExpr(const ImplicitCastExpr *E) {
llvm::Value *Ops[] = {Idx0, Idx0};
return Builder.CreateGEP(V, Ops, Ops+2, "arraydecay");
} else if (E->getType()->isReferenceType()) {
assert(cast<ReferenceType>(E->getType())->getReferenceeType() ==
Op->getType() && "Incompatible types!");
assert(cast<ReferenceType>(E->getType().getCanonicalType())->
getReferenceeType() ==
Op->getType().getCanonicalType() && "Incompatible types!");
return EmitLValue(Op).getAddress();
}